Skip to content

Conversation

@marco-saia-datadog
Copy link
Member

@marco-saia-datadog marco-saia-datadog commented Dec 10, 2025

What does this PR do?

  • FIX:

    • Baggage Header entries were not correctly formatted in DatadogTracingContext, breaking DdRum.getTracingContext(..) and DdRum.getTracingContextForPropagators(...)
    • Remove duplicate insert of RUM Session ID in Baggage Header entries
    • Added missing unit tests for the insertion of User ID & Account ID in Baggage Header
  • NEW:

    • Do not encode or drop user-defined baggage header entries; we now check whether the entry is datadog-specific, and we only perform encoding in that case. If user entries are not W3C compliant, we log a warning.
    • Do not double-encode entries; we now handle the edge case where a header we encode has been already encoded beforehand

New Requirements

  • Do not double-encode: Percent-encoded values must not be percent-encoded again.
  • Do not drop malformed or non-standard entries: User-provided entries must always be preserved, even if they do not conform to the W3C Baggage header specification (W3C “Baggage” Recommendation); a warning should be logged in order to notify our users.
  • Normalize spacing: Trailing spaces should always be trimmed, not percent-encoded.

Additional Notes

  • ref: RUM-13042, RUM-13056

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)
  • If this PR is auto-generated, please make sure also to manually update the code related to the change

* Handle Baggage Headers properly in DatadogTracingContext
* Do not encode or drop user-defined baggage header entries
* Do not double-encode entries
* Remove duplicate insert of RUM Session ID
@marco-saia-datadog marco-saia-datadog requested a review from a team as a code owner December 10, 2025 10:32
sbarrio
sbarrio previously approved these changes Dec 11, 2025
@marco-saia-datadog marco-saia-datadog merged commit 50a7b8e into feature/v3 Dec 15, 2025
9 checks passed
@marco-saia-datadog marco-saia-datadog deleted the marcosaia/fix/baggage-header-entries branch December 15, 2025 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants