-
Notifications
You must be signed in to change notification settings - Fork 129
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
RUMM-2619 Manual otel b3 headers injection #1057
Conversation
Sources/Datadog/Tracing/Propagation/OpenTelemetry/OpenTelemetryHTTPHeadersReader.swift
Outdated
Show resolved
Hide resolved
Sources/Datadog/Tracing/Propagation/OpenTracing/TracingHTTPHeaders.swift
Show resolved
Hide resolved
e82a627
to
c2d5de4
Compare
There was a problem hiding this 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
Sources/Datadog/Tracing/Propagation/OpenTelemetry/OpenTelemetryHTTPHeadersWriter.swift
Outdated
Show resolved
Hide resolved
Sources/Datadog/Tracing/Propagation/OpenTelemetry/OpenTelemetryHTTPHeadersWriter.swift
Outdated
Show resolved
Hide resolved
Sources/Datadog/Tracing/Propagation/OpenTelemetry/OpenTelemetryHTTPHeadersWriter.swift
Outdated
Show resolved
Hide resolved
Sources/Datadog/Tracing/Propagation/OpenTelemetry/OpenTelemetryHTTPHeadersReader.swift
Outdated
Show resolved
Hide resolved
Sources/Datadog/Tracing/Propagation/OpenTelemetry/OpenTelemetryHTTPHeadersWriter.swift
Outdated
Show resolved
Hide resolved
Sources/Datadog/Tracing/Propagation/OpenTelemetry/OpenTelemetryHTTPHeadersWriter.swift
Outdated
Show resolved
Hide resolved
@maxep Thanks for a great review! I addressed all the suggestions. Ready for the second pass 🙌 |
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 ReportBranch report: ✅ |
There was a problem hiding this 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 👏
There was a problem hiding this 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.
Sources/Datadog/Tracing/Propagation/OpenTelemetry/OpenTelemetryHTTPHeadersWriter.swift
Show resolved
Hide resolved
Sources/Datadog/Tracing/Propagation/OpenTelemetry/OpenTelemetryHTTPHeadersWriter.swift
Show resolved
Hide resolved
Tests/DatadogTests/Datadog/Tracing/Propagation/OpenTelemetryHTTPHeadersReaderTests.swift
Show resolved
Hide resolved
Tests/DatadogTests/Datadog/Tracing/Propagation/OpenTelemetryHTTPHeadersWriterTests.swift
Show resolved
Hide resolved
@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. |
What and why?
Adds
OpenTelemetryHTTPHeadersWriter
andOpenTelemetryHTTPHeadersReader
. 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
Custom CI job configuration (optional)