Skip to content

Update PropagationContext on changes #5322

@sentrivana

Description

@sentrivana

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions