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 摘要。