Support span links for auto-instrumented network spans on Android

未關閉
#6,168 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
32/100
Issue 類型
功能
描述清晰度
需要釐清
活躍度
活躍
技術堆疊
android, kotlin

研究方向

No Android networking integration, context-management files, or tests are named. Start by locating the Android auto-instrumented network-span and span/context APIs, then compare the linked OpenTelemetry and Sentry span-link guidance. Done requires an agreed API or instrumentation hook that preserves the existing parent, supports explicit links, and has verified Trace View behavior.

由索引模型根據 Issue 內容生成。

描述

Android Feature Platform: Java Spans
Problem Statement

An Android application using Kotlin needs to associate an auto-instrumented network span with other relevant operations while retaining one parent.

A simplified illustration of the requested workflow:

  1. Operation A supplies the current context for network span parenting.
  2. Operation B is also running outside that context.
  3. A network request creates span N under A.
  4. The requester wants to link N to B as well, potentially across traces.

The requester described bindToScope in their mobile setup and asked for both Cocoa and Android support. They have not supplied the Android networking integration or context-management code. This is not a verified Android bug reproduction.

  • Choosing one parent leaves other overlapping operations out of the debugging context.
  • The requester thinks viewing and following links in Trace View may be sufficient. Navigation direction and a need for search, filtering, or aggregation remain unconfirmed.
  • No workaround for the additional relationships has been reported. A rollout blocker and quantified debugging cost have not been established.
  • A seven-day telemetry sample observed sentry.java.android 8.53.0 and 8.47.0 on September 24, 2026. These are deployed versions, not verified minimum affected versions. Kotlin Multiplatform is not confirmed and is outside this request's scope.
Solution Brainstorm

Provide a supported way to add links to auto-instrumented network spans without replacing their parent or duplicating the span.

  • OpenTelemetry's span-link documentation describes links to one or more spans as causal relationships. The requester asked to link all active spans but welcomes guidance. Time overlap alone does not establish causality, so automatic linking to every active span is not a requirement.
  • Sentry's span-link development guidance describes links at span creation and an addLink method on the span interface. Links identify the target trace and span. This is the proposed model, not evidence that Android implements these APIs.
  • Assess which API or instrumentation hook would let application code attach links to automatically created network spans. The desired result is to inspect and follow those relationships in Trace View. Cross-trace behavior and navigation direction need assessment.

If better parent selection or a view of concurrent operations fits the need better, guidance on that alternative would help.

Related Cocoa request: sentry-cocoa #9165.

via ben.davis.

--

View Junior Session [Sentry]

主要語言
Kotlin
星號
1.4k
分支
483
平均合併
2 天 54 分鐘
30 天內合併 PR
207

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

getsentry/sentry-java 的其他 Issue

查看 getsentry/sentry-java 的全部 Issue

相似的 Issue

更多 Kotlin Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。