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

RUMM-2619 Manual otel b3 headers injection #1057

Merged
merged 13 commits into from
Nov 23, 2022

Conversation

maciejburda
Copy link
Member

What and why?

Adds OpenTelemetryHTTPHeadersWriter and OpenTelemetryHTTPHeadersReader. That allow manual injection of the Open Telemetry b3 header (both single and multiple).

Currently we only support 64-bit version of the tracing header due to backward compatibility issues. Main issue is related to setup of current Open Tracing headers in RUM which rely on decimal instead of hex and no out of the box solution for 128-bit.

I plan to reiterate on this while implementing automatic injection.

How?

This implementation follows specification from https://github.com/openzipkin/b3-propagation while navigating around internal implementation details. This PR is initial take on the problem that will be expanded in the automatic injection PR.

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
  • Run integration tests
  • Run smoke tests

@maciejburda maciejburda requested a review from a team as a code owner November 17, 2022 12:49
@maciejburda maciejburda force-pushed the maciey/RUMM-2619-manual-otel-b3-headers-injection branch from e82a627 to c2d5de4 Compare November 21, 2022 09:18
Copy link
Member

@maxep maxep left a comment

Choose a reason for hiding this comment

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

Very nice, the documentation and tests looks great 👌

I wonder if we shouldn't reuse naming from OpenTelemetry, cf: https://www.npmjs.com/package/@opentelemetry/propagator-b3

e.g.: B3PropagatorWriter/B3PropagatorReader

@maciejburda
Copy link
Member Author

@maxep Thanks for a great review! I addressed all the suggestions. Ready for the second pass 🙌

@maciejburda
Copy link
Member Author

Note: I talked to @ncreated and for now we won't support 128-bit encoding. Values of tracing headers were hidden from the consumer, so we decided to keep it this way. Difficult part for automatic switch was hex/decimal encoding.

I incorporated code related to it in this PR - it will ease the work on the automatic Open Telemetry support (from DD configuration).

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Nov 21, 2022

Datadog Report

Branch report: maciey/RUMM-2619-manual-otel-b3-headers-injection
Commit report: fe915ad

dd-sdk-ios 0 Failed, 0 New Flaky, 116 Passed, 0 Skipped, 4m 28.21s Wall Time

Copy link
Member

@maxep maxep left a comment

Choose a reason for hiding this comment

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

Awesome, well done @maciejburda 👏

Copy link
Member

@ncreated ncreated left a comment

Choose a reason for hiding this comment

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

Excellent work! 💪 Everything seems to be on the right place and having a pair of (public) writer + (internal) reader is a good choice - it should make it much easier for automatic injection (where both are in use).

I few feedbacks - none is blocking, but I would like to hear your opinion.

@maciejburda
Copy link
Member Author

maciejburda commented Nov 23, 2022

@ncreated Great feedback! I will incorporate all the comments in a separate PR if you don't mind. I want to leverage the fact that this one is already approved on CI.

@maciejburda maciejburda merged commit 17906b5 into develop Nov 23, 2022
@maciejburda maciejburda deleted the maciey/RUMM-2619-manual-otel-b3-headers-injection branch November 23, 2022 13:21
@ncreated ncreated mentioned this pull request Dec 7, 2022
6 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.

4 participants