-
Notifications
You must be signed in to change notification settings - Fork 160
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
Add span links capabilities to the OTel API #2451
Conversation
1dfd0db
to
ab750d8
Compare
d8390fc
to
2908881
Compare
Co-authored-by: Bob Weinand <[email protected]>
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.
Thanks! Looks good to me :-)
BenchmarksBenchmark execution time: 2024-01-10 12:38:41 Comparing candidate commit in PR branch `` with baseline commit 77781a4 in branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 36 metrics, 54 unstable metrics. |
Description
Add the span links to the OpenTelemetry API.
Please note the following points about converting Datadog spans to OpenTelemetry (OTel) spans and creating span links:
\DDTrace\SpanLink
instances are also created.It is important to note that span links can be added to a span at any point during its lifetime using the Datadog (DD) API, but such links can only be added using the OTel API during the build phase. This limitation is not a problem with the DD API but with the OTel API. To address this, DD span links are actualized onto the OTel span when creating an immutable span from it (
toSpanData()
). This is the only way to access the links associated with an OTel span. Span Links removal is supported and actualized during the same step.Span Links limits aren't supported, as such a concept doesn't exist in the DD API and is irrelevant.
A WeakMap is used to store information about previously instantiated span links that are associated with an OpenTelemetry (OTel) span. When a span link is added to an OTel span, a one-to-one relationship is established between the
SpanLink
andLink
instances to ensure consistency. This is necessary because duplicate span links are allowed. I'd advise to look at the added Interoperability Tests to understand better what I mean :)Reviewer checklist