Ktor client: HTTP span shows the redirect’s status instead of the final response
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
Start by reading the sentry-ktor-client implementation of SentryKtorClientPlugin and its tests for redirect handling; the issue names no specific file or test. Reproduce with Ktor 3.0.0 using a 302 redirect followed by a delayed 500, then trace when the HTTP span is closed and beforeSpan is called. Done when the span covers the full redirect chain, reflects the final response status, and beforeSpan runs once before closure.
索引モデルが issue の本文から書いたものです。
説明
Integration
other
Java Version
17
Other Error Monitoring Solution
No
Other Error Monitoring Solution Name
No response
Version
8.61.0
Steps to Reproduce
Integration: sentry-ktor-client 8.61.0, Ktor client 3.0.0 (Java engine)
- Set up a server where /start returns 302 to /fail, and /fail returns 500 after a short delay.
- Make a request to /start with a Ktor client that uses SentryKtorClientPlugin (redirects are followed by default), inside a transaction.
- Look at the trace in Sentry: the http.client span is ok and much shorter than the request, even though a “HTTP Client Error with status code: 500” event is captured
- Repeat with waitForChildren = true on the transaction and call finish() while the request is in flight: the transaction is sent before the 500 comes back.
Example from my own test org: https://kismeow.sentry.io/explore/traces/?end=2026-10-21T23%3A59%3A59&field=id&field=span.name&field=span.description&field=span.duration&field=transaction&field=timestamp&field=span.status&project=-1&start=2026-10-21T00%3A00%3A00&utc=true
Expected Result
The span stays open for the whole redirect chain, then gets the final response's status and is passed to beforeSpan once before it's closed.
Actual Result
When a request made with SentryKtorClientPlugin gets redirected, the HTTP span is closed as soon as the redirect comes back, not when the final response arrives.
For a request that goes 302 → 500:
- The span is marked ok, even though the request ended with a 500 (the 500 error event is still captured).
- The span's duration covers only the redirect response, so it looks much faster than it really was.
- beforeSpan is called for every response in the redirect chain. The second call gets a span that’s already closed.
- If the transaction waits for its child spans (waitForChildren), it gets sent right after the redirect, before the request is actually done.
- 主要言語
- Kotlin
- スター
- 1.4k
- フォーク
- 483
- 平均マージ
- 2日 54分
- マージ済み PR(30日)
- 207
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
getsentry/sentry-java のほかの issue
-
Test the `sentry wizard` Android port対応中かも @antonis が 1 日前に担当しました。 オープンPlatform: Java
getsentry/sentry-java#6797 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Narrow and clean up Android consumer keep rules対応中かも @runningcode が 3 日前に担当しました。 オープンAndroid Platform: Java
getsentry/sentry-java#6771 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Android Bug Platform: Java Waiting for: Product Owner
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
getsentry/sentry-java#6758 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
Android Bug Platform: Java Replays
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
getsentry/sentry-java#6741 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Android Bug Platform: Java Replays
難易度 3/5 1〜2日 初心者へのやさしさ 50/100
getsentry/sentry-java#6740 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
getsentry/sentry-java の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
IacobIonut01/ReFra#1515 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
openwatersio/slackwater-android#162 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 半日 初心者へのやさしさ 72/100
developmentwithyash/yaan#184 ·
メンテナーはふだん 1 日以内に返信
-
analytics
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
🐛 Type:Bug 📏 Size: S 🔧 State:In Progress 🔹 Priority: P2 - Medium
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
yeliqin666/xjtu-toolbox-android#623 · コメント 1 件 ·