Support span links for auto-instrumented network spans on Android

Ouverte
#6,168 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
32/100
Type d'issue
Fonctionnalité
Clarté
À clarifier
Activité
Active
Stack technique
android, kotlin

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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]

Langage dominant
Kotlin
Étoiles
1.4k
Forks
483
Merge moyen
2 j 54 min
PR mergées (30 j)
207

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de getsentry/sentry-java

Toutes les issues de getsentry/sentry-java

Issues similaires

Plus d'issues Kotlin

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.