File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
sentry-samples/sentry-samples-ktor/src/main/java/io/sentry/samples/ktor Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ package io.sentry.samples.ktor
33import io.ktor.client.*
44import io.ktor.client.engine.java.*
55import io.ktor.client.request.*
6+ import io.ktor.http.HttpStatusCode
7+ import io.sentry.HttpStatusCodeRange
68import io.sentry.Sentry
79import io.sentry.TransactionOptions
810import io.sentry.ktor.SentryKtorClientPlugin
@@ -20,7 +22,13 @@ fun main() {
2022 }
2123
2224 val client =
23- HttpClient (Java ) { install(SentryKtorClientPlugin ) { failedRequestTargets = listOf (" .*" ) } }
25+ HttpClient (Java ) {
26+ install(SentryKtorClientPlugin ) {
27+ captureFailedRequests = true
28+ failedRequestTargets = listOf (" .*" )
29+ failedRequestStatusCodes = listOf (HttpStatusCodeRange (500 , 599 ))
30+ }
31+ }
2432
2533 val opts = TransactionOptions ().apply { isBindToScope = true }
2634 val tx = Sentry .startTransaction(" My Transaction" , " test" , opts)
You can’t perform that action at this time.
0 commit comments