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
ref(tracing): Ignore third party baggage entries from incoming requests (#5319)
On incoming requests we no longer parse and put non-`sentry-` baggage entries into the `Baggage` object but we ignore them and instead store an empty third party string. The reason for this change is that - as we discussed and agreed upon - the Sentry SDK should not be responsible for propagating other vendors' data. If users want to propagate that data as well on the service(s) where the Sentry SDK is installed, they should add the other vendors' propagation mechanisms. In fact, this is the only way we can ensure that baggage content that should _not_ be propagated further is actually stopped.
It's important to note that this only concerns _incoming_ 3rd party baggage items. If other vendors (or the users themselves) add a `baggage` header to the outgoing request before the Sentry SDK adds its `baggage` header, we continue to merge the two headers such that the 3rd party baggage as well as this SDK's DSC entries are still in the final header. In (the edge) case that this 3rd party `baggage` header already contains `sentry-` entries, they will be ignored and overwritten with this SDK's `sentry-` entries.
With this patch, our DSC propagation behaviour conforms with [our DSC specification](https://develop.sentry.dev/sdk/performance/dynamic-sampling-context/).
In addition of these changes, this patch also contains a few small cleanups and improvements:
* removed `isBaggageEmpty` helper function (+ tests) as it was not used anymore except for in tests
* simplified mutability check: Because of how we parse incoming baggage headers, we can make the check slightly simpler than the pseudo code in the spec.
* adjusted tests to new 3rd party handling
* added node integration tests to check for correct handling of `baggage` header merging in case another vendor injects a baggage header before the Sentry SDK
0 commit comments