You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(tracing): Add additional Dynamic Sampling Context items to baggage and envelope headers (#5292)
Add several additional Dynamic Sampling Context items to be collected, populated and propagated via baggage or sent via envelope headers. The propagated/sent data now conforms with the specs proposed in getsentry/develop#613.
With this PR, the following fields were added to DSC:
* transaction name
* user id
* user segment
* sample rate
* public key
* trace id
Note that trace id and public key were already previously sent with envelope headers but the SDK would send its own values instead of the trace's values in case it is not the head-of-trace SDK. This PR also fixes that, in the sense that all `trace` envelope header data items are directly taken from the DSC we either received from an incoming baggage header or from the one we populate instead.
In addition to these fields, this patch makes the following changes:
* store final baggage in `event.sdkProcessingMetadata` (was previously stored in `event.contexts.baggage` which was wrong, caused a bug and caused the baggage to even be sent to Sentry (which we do not want in this form).
* fix a bug where populated DSC (which was set immutable) would not be stored on the span. This bug would have affected data consistency across multiple outgoing requests in one transaction, where the second/third/etc outgoing requests would potentially still find a mutable baggage object and populate it again
* rename `_getBaggageDataWithSentryValues` to `_populateBaggageDataWithSentryValues` because it better describes the purpose of the function
0 commit comments