-
Notifications
You must be signed in to change notification settings - Fork 13
feat(data-pipeline-ffi): add functions to manipulate span from C #994
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
base: main
Are you sure you want to change the base?
Conversation
3172f33
to
b6ff6bb
Compare
BenchmarksComparisonBenchmark execution time: 2025-07-11 14:11:23 Comparing candidate commit 5c4e725 in PR branch Found 1 performance improvements and 0 performance regressions! Performance is the same for 51 metrics, 2 unstable metrics. scenario:benching deserializing traces from msgpack to their internal representation
CandidateCandidate benchmark detailsGroup 1
Group 2
Group 3
Group 4
Group 5
Group 6
Group 7
Group 8
Group 9
Group 10
Group 11
Group 12
Group 13
Group 14
BaselineOmitted due to size. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #994 +/- ##
==========================================
- Coverage 71.42% 71.00% -0.43%
==========================================
Files 342 346 +4
Lines 52062 53048 +986
==========================================
+ Hits 37186 37667 +481
- Misses 14876 15381 +505
🚀 New features to boost your workflow:
|
c78046e
to
00df87d
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
|
cee1bc0
to
a9c6aa1
Compare
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.
The Data Pipeline team hasn't seen any design docs or had any conversations about adding this functionality. Also, I'm not ok with tests that can only run on nightly. Our CI is on stable, and we build our releases with stable.
It's an error on my part, the PR was supposed to stay in draft as it is just at the experiment level yet. |
PR wasn't ready for review yet, and was moved to draft.
62862df
to
d7d9779
Compare
0e074ee
to
ac9484b
Compare
0a39708
to
a03994a
Compare
abe97d7
to
ed40e83
Compare
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
…fety Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
ed40e83
to
6779847
Compare
write_str(writer, "span_links")?; | ||
rmp::encode::write_array_len(writer, span.span_links.len() as u32)?; | ||
for link in span.span_links.iter() { | ||
let mut link_len = 3; /* minimal span link: trace_id, trace_id_high, span_id */ |
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.
Could you extract writing a span link and a span event to their functions?
// If it's the first span make it the root | ||
let span_id = if i == 0 { | ||
root_span_id | ||
} else { | ||
root_span_id + i as u64 + 1 | ||
}; |
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.
if i == 0 the root_span_id + i as u64
is root_span_id, otherwise it's a new value?
// If it's the first span make it the root | |
let span_id = if i == 0 { | |
root_span_id | |
} else { | |
root_span_id + i as u64 + 1 | |
}; | |
// If it's the first span make it the root | |
let span_id = root_span_id + i as u64; |
/// # Safety | ||
/// Callers must ensure this is only used for read or drop purposes | ||
/// that are compatible with how the memory was originally allocated. | ||
pub const fn as_raw_parts(&self) -> (*const T, usize) { | ||
(self.ptr, self.len) | ||
} | ||
|
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.
Where is this used in this PR?
What does this PR do?
This PR add functions to create and manipulate field of Rust Span struct from C code.
Motivation
The replacement of PHP Span to Rust Span in the PHP Tracer.
Additional Notes
As I am using macros to create the functions, the tests need to be run on a nightly version of Rust.
How to test the change?
Tests have been added, and this is linked to another one in the PHP tracer. (TODO)