Datasets:
Download cases/getsentry/getsentry_sentry_python_sentry_ruby_102dddf76ba8/prompt.md from wangbaoyi/WideSWE: direct link, hf CLI and curl.
- Browser
- Download file 1.86 kB
-
https://huggingface.co/datasets/wangbaoyi/WideSWE/resolve/main/cases/getsentry/getsentry_sentry_python_sentry_ruby_102dddf76ba8/prompt.md
- Command line
-
hf download hf://datasets/wangbaoyi/WideSWE/cases/getsentry/getsentry_sentry_python_sentry_ruby_102dddf76ba8/prompt.md
-
curl -L -o prompt.md https://huggingface.co/datasets/wangbaoyi/WideSWE/resolve/main/cases/getsentry/getsentry_sentry_python_sentry_ruby_102dddf76ba8/prompt.md
Custom baggage is overwritten with Sentry values on outgoing requests.
Python SDK
Currently, any library that is patched by Sentry tries to append the baggage header whenever possible, for example httpx. When an outgoing request already has custom data in the baggage header, the destination of the call does not receive the original custom baggage. Other integrations use a similar approach to the httpx one and may be affected too.
To reproduce:
- Initialize a project with
sentry-sdk==1.26.0andhttpx. - Initialize Sentry with
sentry_sdk.init(default_integrations=True, auto_enabling_integrations=True). - Make a call with an
httpxclient such asclient.get("/path", headers={"baggage": "custom=value"}).
Ruby SDK
Sentry::Utils::HttpTracing#set_propagation_headers overwrites propagation headers on outgoing HTTP requests. While this is fine for the Sentry-specific sentry-trace header, the baggage header is a W3C standard shared across multiple systems. Pre-existing baggage entries may be set by OpenTelemetry, application code, or other instrumentation.
To reproduce:
- Set a custom
baggageheader on an outgoing HTTP request, for exampleroutingKey=myvalue,tenantId=123. - Ensure
propagate_tracesis enabled and the target URL matchestrace_propagation_targets. - Make the request using
Net::HTTP,Faraday, orExcon. - Inspect the outgoing request headers.
Expected Result
When a baggage header already exists on the outgoing request, Sentry should merge its entries with the existing value by joining them with a comma (,), as per the W3C Baggage specification. The Sentry baggage and the original custom baggage values should both be present.
Actual Result
Sentry baggage overwrites the whole baggage value, leaving Sentry values only. The original custom entries are lost.