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
{{ message }}
Repository navigation
set_propagation_headers overwrites existing baggage header instead of merging #2894
Sentry::Utils::HttpTracing#set_propagation_headers unconditionally overwrites all propagation headers on outgoing HTTP requests using req[k] = v. While this is fine for the Sentry-specific sentry-trace header, the baggage header is a W3C standard shared across multiple systems. Any pre-existing baggage entries (e.g. set by OpenTelemetry, application code, or other instrumentation) are silently discarded.
Set a custom baggage header on an outgoing HTTP request (e.g. routingKey=myvalue)
Ensure propagate_traces is enabled in Sentry config and the target URL matches trace_propagation_targets
Make the HTTP request using Net::HTTP, Faraday, or Excon
Inspect the outgoing request headers
require"net/http"Sentry.initdo |config|
config.dsn="https://key@sentry.io/1"config.traces_sample_rate=1.0config.propagate_traces=trueenduri=URI("https://example.com/api")req=Net::HTTP::Get.new(uri)req["baggage"]="routingKey=myvalue,tenantId=123"# After Sentry instruments this request, the baggage header# will only contain sentry-* entries -- the original values are lostNet::HTTP.start(uri.hostname,uri.port,use_ssl: true){ |http| http.request(req)}
Expected Behavior
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 Bagga
ge specification. The resulting header should look like:
Activity
linear-code commentedon Mar 16, 2026
RUBY-159