feat: support for OTLP trace export (http/json)#7531
Conversation
Overall package sizeSelf size: 5.46 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.0.0 | 81.15 kB | 815.98 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #7531 +/- ##
==========================================
+ Coverage 80.17% 80.45% +0.27%
==========================================
Files 731 736 +5
Lines 31212 31669 +457
==========================================
+ Hits 25025 25479 +454
- Misses 6187 6190 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-03-29 23:38:38 Comparing candidate commit e225831 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 230 metrics, 30 unstable metrics. |
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 58b85ba | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7531 +/- ##
===========================================
- Coverage 80.17% 68.35% -11.83%
===========================================
Files 731 693 -38
Lines 31212 29252 -1960
===========================================
- Hits 25025 19995 -5030
- Misses 6187 9257 +3070
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7531 +/- ##
===========================================
- Coverage 80.17% 49.94% -30.23%
===========================================
Files 731 362 -369
Lines 31212 16297 -14915
===========================================
- Hits 25025 8140 -16885
- Misses 6187 8157 +1970
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7531 +/- ##
===========================================
- Coverage 80.17% 63.85% -16.33%
===========================================
Files 731 540 -191
Lines 31212 23167 -8045
===========================================
- Hits 25025 14793 -10232
- Misses 6187 8374 +2187
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1 similar comment
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7531 +/- ##
===========================================
- Coverage 80.17% 63.85% -16.33%
===========================================
Files 731 540 -191
Lines 31212 23167 -8045
===========================================
- Hits 25025 14793 -10232
- Misses 6187 8374 +2187
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7531 +/- ##
===========================================
- Coverage 80.17% 64.07% -16.10%
===========================================
Files 731 544 -187
Lines 31212 23228 -7984
===========================================
- Hits 25025 14884 -10141
- Misses 6187 8344 +2157
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7531 +/- ##
===========================================
- Coverage 80.17% 66.61% -13.57%
===========================================
Files 731 560 -171
Lines 31212 23830 -7382
===========================================
- Hits 25025 15874 -9151
- Misses 6187 7956 +1769
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7531 +/- ##
==========================================
- Coverage 80.17% 77.21% -2.97%
==========================================
Files 731 728 -3
Lines 31212 31411 +199
==========================================
- Hits 25025 24253 -772
- Misses 6187 7158 +971
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1 similar comment
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7531 +/- ##
==========================================
- Coverage 80.17% 77.21% -2.97%
==========================================
Files 731 728 -3
Lines 31212 31411 +199
==========================================
- Hits 25025 24253 -772
- Misses 6187 7158 +971
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7531 +/- ##
==========================================
- Coverage 80.48% 73.76% -6.73%
==========================================
Files 749 768 +19
Lines 32473 35930 +3457
==========================================
+ Hits 26136 26503 +367
- Misses 6337 9427 +3090
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| const links = this.#extractLinks(span.meta?.['_dd.span_links']) | ||
|
|
||
| return { | ||
| traceId: this.#idToBytes(span.trace_id, 16), |
There was a problem hiding this comment.
Note for later: When we later implement http/protobuf and grpc protocols, I think this DD->OTLP Span code can be re-used with some small tweaks. If we instead return traceId, spanId, and parentSpanId with them having the Buffer type, the http/protobuf and gRPC writers can use the buffer directly whereas the JSON serializer can call toString('hex') on the Buffer objects
There was a problem hiding this comment.
thank you Zach for this note! :D
…l() is always called" This reverts commit 002345b.
| if (span.meta_struct) { | ||
| for (const [key, value] of Object.entries(span.meta_struct)) { | ||
| const bytes = Buffer.from(JSON.stringify(value)) | ||
| attributes.push({ key, value: { bytesValue: bytes.toString('base64') } }) |
There was a problem hiding this comment.
Note for follow-up PR's: When setting properties that originated from the meta_struct dictionary, their resulting protobuf type should be bytes. So when we implement protobuf-based protocols, we shouldn't be calling bytes.toString('base64') so we'll need to do some refactoring when we get there
There was a problem hiding this comment.
thanks Zach I'll keep it in mind ^ ^
zacharycmontoya
left a comment
There was a problem hiding this comment.
From the requirements level, LGTM! I left a number of nits but nothing is blocking from my perspective. And this will also need approval from a Node.js expert
zacharycmontoya
left a comment
There was a problem hiding this comment.
LGTM. Thanks for addressing all my feedback 🙏🏼
What does this PR do?
This is the dd-trace-js counterpart to this dotnet PR. But since there is no trace stats computation in dd-trace-js, this PR doesn't export any metrics, so is smaller than the dotnet PR
Motivation
Additional Notes
[OUTDATED:]
This PR is broken into three parts. You can renew these small chunks if that makes reviewing easier :) I can merge in these chunks in sequence as an alternative to merging in this large PR at once
#7830
#7831
#7832