refactor(span)!: use VecMap for meta, metrics and meta_struct for v04 spans#2043
Conversation
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: a2b962e | Docs | Datadog PR Page | Give us feedback! |
Clippy Allow Annotation ReportComparing clippy allow annotations between branches:
Summary by Rule
Annotation Counts by File
Annotation Stats by Crate
About This ReportThis report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality. |
meta, metrics and meta_struct
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## yannham/vecmap-as-dedup #2043 +/- ##
===========================================================
- Coverage 72.92% 72.91% -0.01%
===========================================================
Files 460 460
Lines 76481 76558 +77
===========================================================
+ Hits 55774 55824 +50
- Misses 20707 20734 +27
🚀 New features to boost your workflow:
|
1c727ec to
a9e644d
Compare
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
681d36f to
95d3d03
Compare
meta, metrics and meta_structmeta, metrics and meta_struct
meta, metrics and meta_structmeta, metrics and meta_struct for v04 spans
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95d3d03685
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
74358f8 to
7e38b23
Compare
2d45a7f to
8f43f82
Compare
3dc15ea to
57b3ec4
Compare
The trace_buffer benchmark was still using HashMap for Span meta, metrics, and meta_struct fields after the VecMap migration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The decoder functions were returning Vec<(K, V)> which callers immediately converted to VecMap via .into(). Return VecMap directly to avoid the unnecessary intermediate type. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
70b40a4 to
a2b962e
Compare
# What does this PR do? Add foundation types for dd-trace-js change buffer: buffer, opcodes and trace. Follow up of #2043. # Motivation See #2022. Required for the integration of native spans into dd-trace-js. # Additional Notes This PR just introduces the types and doesn't use them yet, hence the `allow(unused)`. # How to test the change? Unit tests provided. Co-authored-by: ekump <edmund.kump@datadoghq.com> Co-authored-by: yann.hamdaoui <yann.hamdaoui@datadoghq.com>
Depends on #2022 and #2049.
What does this PR do?
This PR continues the native span performance work required to land native spans in dd-trace-js. Follow-up of #2022. Actually use
VecMapin theSpandata structure.Motivation
Performance improvement following dd-trace-js native span experiments. See #2022.
Additional considerations
There are some deduplication design choices. We deduplicate before serializing to the agent, because while the current agent implementation would support duplicate keys in a map (with the same semantics of "last one wins"), this is not part of the spec/API, so we can't rely on it. We also deduplicate defensively in the msgpack encoder, but it should already be deduped at this stage.
For byte estimate (
byte_size()), we make the choice of not deduplicating. This means potentially overestimating the size of a chunk (and reaching the limit sooner), in exchange of delaying the deduplication to serialization time.How to test the change?
Run tests.