Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUM-1923 feat: add tracestate headers when using W3C tracecontext #1536

Merged
merged 3 commits into from
Nov 3, 2023

Conversation

ganeshnj
Copy link
Contributor

@ganeshnj ganeshnj commented Nov 3, 2023

What and why?

Currently, we don't send vendor specific information (Datadog here) when using W3C tracecontext headers for distibuted tracing.

How?

This PR adds the vendor specific information to the tracecontext headers.

Datadog tracecontext (W3C)
x-datadog-sampling-priority s:{sampling-priority}
x-datadog-origin o:{origin}

Example

x-datadog-trace-id: 1229782938247303441 (0x1111111111111111)
x-datadog-parent-id: 2459565876494606882 (0x2222222222222222)
x-datadog-sampling-priority: 2
x-datadog-origin: rum
x-datadog-tags: _dd.p.dm=-4,_dd.p.usr.id=baz64==

translates to

traceparent: 00-00000000000000001111111111111111-2222222222222222-01
tracestate: dd=s:2;o:rum;t.dm:-4;t.usr.id:baz64~~,othervendor=t61rcWkgMzE

x-datadog-tags is not supported by the SDK, hence it is not added to the tracecontext headers.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference
  • Add CHANGELOG entry for user facing changes

Custom CI job configuration (optional)

  • Run unit tests for Core, RUM, Trace, Logs, CR and WVT
  • Run unit tests for Session Replay
  • Run integration tests
  • Run smoke tests
  • Run tests for tools/

### What and why?

Currently, we don't send vendor specific information (Datadog here) when using W3C tracecontext headers for distibuted tracing.

### How?

This PR adds the vendor specific information to the tracecontext headers.

Datadog | tracecontext (W3C)
- | -
x-datadog-sampling-priority | s:{sampling-priority}
x-datadog-origin | o:{origin}

x-datadog-tags is not supported by the SDK, hence it is not added to the tracecontext headers.
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Nov 3, 2023

Datadog Report

Branch report: ganeshnj/feat/RUM-1923-tracestate
Commit report: 8041ac5

dd-sdk-ios: 0 Failed, 0 New Flaky, 2652 Passed, 0 Skipped, 13m 16.21s Wall Time

@ganeshnj ganeshnj marked this pull request as ready for review November 3, 2023 12:44
@ganeshnj ganeshnj requested a review from a team as a code owner November 3, 2023 12:44
Copy link
Contributor

@maciejburda maciejburda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ganeshnj ganeshnj merged commit 0a6c98d into develop Nov 3, 2023
8 checks passed
@maxep maxep mentioned this pull request Nov 8, 2023
8 tasks
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.

None yet

3 participants