feat(trace-utils)!: add dedup convenience to VecMap#2049
Conversation
📚 Documentation Check Results📦
|
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. |
🔒 Cargo Deny Results📦
|
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 0996e9a | Docs | Datadog PR Page | Give us feedback! |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2049 +/- ##
==========================================
+ Coverage 72.90% 73.07% +0.16%
==========================================
Files 460 460
Lines 76396 76789 +393
==========================================
+ Hits 55696 56110 +414
+ Misses 20700 20679 -21
🚀 New features to boost your workflow:
|
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
|
Avoid the redundant collect from HashMap back into Vec when deduping. The Owned variant now holds a HashMap<&K, &V> directly, removing one allocation and copy. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
What does this PR do?
Follow-up of #2022. This split off some work required in #2043 for deduplication before msgpack encoding as a separate PR.
Motivation
See #2022 for overall motivation. To integrate
VecMap, it turns out we can't currently rely on the agent to properly handle maps with deuplicate entries (the "last win" semantics is the current implementation, but not guaranteed). We need to perform deduplication before msgpack encoding. This PR backports the required machinery intoVecMapas a separate PR.Additional Notes
N/A
How to test the change?
Tests included.