getsentry / getsentry/sentry-python

Update PropagationContext on changes

Aperta
#5,322 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Improvement Python Spans
Lingua principale
Python
Stelle
2.2k
Fork
669
Merge medio
1g 40m
PR unite (30g)
212

Descrizione

Currently, we only ever update the PropagationContext on trace start or trace continuation. It's then not kept in sync with what's actually going on: for example, the `span_id` field is never updated to the actual running span, and the `parent_span_id` field is not updated to the parent of the currently running span.

This means we have a lot of fragmented logic all around, first checking the active span for data, and only falling back to the PropagationContext when not available. The PropagationContext should be the single point of truth.

## Goals
- update the propagation context's `span_id`, `parent_span_id` whenever these change, so that they represent the actual current state
- check for places where we fall back to checking the propagation context and change them so that we use propagation context only (i.e., don't check for current span first, just use whatever is stored in the propagation context)

## Notes
- Might be easier to do after we've ripped out the old tracing code with the changes for Span First.
- See how this interacts with `scope.span`

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.