feat(native-spans)!: change buffer foundation#2046
Conversation
|
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. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## yannham/span-vec-fields-integration #2046 +/- ##
=======================================================================
+ Coverage 72.91% 73.00% +0.09%
=======================================================================
Files 460 465 +5
Lines 76558 76894 +336
=======================================================================
+ Hits 55824 56139 +315
- Misses 20734 20755 +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
|
8962592 to
66fb3e6
Compare
2d45a7f to
8f43f82
Compare
d3b289b to
3dc15ea
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>
3dc15ea to
57b3ec4
Compare
Add the supporting types for the change-buffer module behind a `change-buffer` feature flag: ChangeBuffer (raw memory wrapper), OpCode/BufferedOperation, SpanHeader (repr(C)), SmallTraceMap, Trace, and error types. These are the building blocks for ChangeBufferState which follows in the next commit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
66fb3e6 to
8431f28
Compare
📚 Documentation Check Results📦
|
🔒 Cargo Deny Results📦
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8431f288d1
ℹ️ 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".
| //! | ||
| //! The change buffer is currently designed and used for dd-trace-js, but the idea could be extended | ||
| //! to other runtime where the FFI cost is high. | ||
| #[allow(unused)] |
There was a problem hiding this comment.
Make the unused allow cover the module
With the change-buffer feature enabled, this outer attribute only applies to the following ChangeBufferError enum, so the rest of the new module still emits unused-import and dead-code warnings. I checked RUSTFLAGS='-D warnings' cargo check -p libdd-trace-utils --features change-buffer, and it fails on the unused imports/helpers and BufferedOperation; the required all-features clippy invocation also promotes these warnings to errors. Make this an inner module attribute (or remove the unused items) so the feature can pass CI.
Useful? React with 👍 / 👎.
|
|
||
| /// A handle to a change buffer shared with another runtime. The memory is shared, meaning that | ||
| /// cloning is cheap (copying the pointer and length). | ||
| #[derive(Clone, Copy)] |
There was a problem hiding this comment.
Would it be better for this to be only Clone to prevent any accidental implicit copying?
Actually, does this need to even be clone?
There was a problem hiding this comment.
I would tend to think cloning/copying should be ok, since ChangeBuffer is effectively just a shared pointer (and a length). It's not needed on the libdatadog side (it compiles if I remove it), but not sure about the code on libdatadog-nodejs side though.
Co-authored-by: Edmund Kump <edmund.kump@datadoghq.com>
7439489 to
54592a2
Compare
54592a2 to
cc56cd2
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.