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 摘要。