getsentry / getsentry/sentry-python

Update PropagationContext on changes

未关闭
#5,322 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Improvement Python Spans
主要语言
Python
星标
2.2k
派生
669
平均合并
1 天 1 小时
30 天内合并 PR
213

描述

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`

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。