Skip to content

Commit 665b6ec

Browse files
committed
improve
1 parent 80fb52f commit 665b6ec

File tree

1 file changed

+9
-1
lines changed
  • sentry-samples/sentry-samples-ktor/src/main/java/io/sentry/samples/ktor

1 file changed

+9
-1
lines changed

sentry-samples/sentry-samples-ktor/src/main/java/io/sentry/samples/ktor/Main.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package io.sentry.samples.ktor
33
import io.ktor.client.*
44
import io.ktor.client.engine.java.*
55
import io.ktor.client.request.*
6+
import io.ktor.http.HttpStatusCode
7+
import io.sentry.HttpStatusCodeRange
68
import io.sentry.Sentry
79
import io.sentry.TransactionOptions
810
import 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)

0 commit comments

Comments
 (0)