-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix the trace payload size hint #664
Conversation
The incoming buffer may be much larger than the actual contained data. The decoder knows where the payload starts and ends, but the sidecar send_trace_v04 method does not. This ensures proper trace coalescing, leading to less individual http requests. Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
fe21d84
to
80d69c1
Compare
BenchmarksComparisonBenchmark execution time: 2024-10-03 17:32:10 Comparing candidate commit ce20078 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 51 metrics, 2 unstable metrics. 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
BaselineOmitted due to size. |
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.
I have some non-blocking style questions I'll ask later, due to urgency of getting this merged. LGTM after we add a unit test.
@@ -47,49 +47,56 @@ use tinybytes::{Bytes, BytesString}; | |||
/// }; | |||
/// let encoded_data = to_vec_named(&vec![vec![span]]).unwrap(); | |||
/// let encoded_data_as_tinybytes = tinybytes::Bytes::from(encoded_data); | |||
/// let decoded_traces = from_slice(encoded_data_as_tinybytes).expect("Decoding failed"); | |||
/// let (decoded_traces, _) = from_slice(encoded_data_as_tinybytes).expect("Decoding failed"); |
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.
/// let (decoded_traces, _) = from_slice(encoded_data_as_tinybytes).expect("Decoding failed"); | |
/// let (decoded_traces, _payload_size) = from_slice(encoded_data_as_tinybytes).expect("Decoding failed"); |
I think it's helpful to at least name the variable, even if we don't use it in the example.
@@ -270,7 +277,7 @@ mod tests { | |||
..Default::default() | |||
}; | |||
let encoded_data = rmp_serde::to_vec_named(&vec![vec![span]]).unwrap(); | |||
let decoded_traces = | |||
let (decoded_traces, _) = |
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.
We should probably have at least one unit test that checks we're returning the correct size.
cc34227
to
ce20078
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #664 +/- ##
==========================================
+ Coverage 71.78% 71.79% +0.01%
==========================================
Files 271 271
Lines 40895 40912 +17
==========================================
+ Hits 29357 29374 +17
Misses 11538 11538
|
The incoming buffer may be much larger than the actual contained data. The decoder knows where the payload starts and ends, but the sidecar send_trace_v04 method does not.
This ensures proper trace coalescing, leading to less individual http requests.