getsentry / getsentry/sentry-python

Update PropagationContext on changes

Abierto
#5,322 1 comentario 0 reacciones 0 asignados Ver en GitHub
Improvement Python Spans
Lenguaje dominante
Python
Estrellas
2.2k
Forks
669
Merge medio
1 d 40 min
PR fusionados (30 d)
212

Descripción

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`

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.