-
Notifications
You must be signed in to change notification settings - Fork 13
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
chore: normalize duration so we don't fail parsing spans into protobuf #998
Conversation
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
|
BenchmarksComparisonBenchmark execution time: 2025-04-08 01:23:06 Comparing candidate commit 2793895 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 52 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
Group 13
BaselineOmitted due to size. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #998 +/- ##
==========================================
- Coverage 71.47% 71.45% -0.02%
==========================================
Files 336 337 +1
Lines 50496 50509 +13
==========================================
+ Hits 36091 36093 +2
- Misses 14405 14416 +11
🚀 New features to boost your workflow:
|
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.
serializer.rs
but it's mean for deserializing?
Should we change the name of it?
".pb.Span.service", | ||
"#[serde(default)] #[serde(deserialize_with = \"crate::serializers::deserialize_null_into_default\")]", | ||
); | ||
config.field_attribute( | ||
".pb.Span.name", | ||
"#[serde(default)] #[serde(deserialize_with = \"crate::serializers::deserialize_null_into_default\")]", | ||
); | ||
config.field_attribute( | ||
".pb.Span.resource", | ||
"#[serde(default)] #[serde(deserialize_with = \"crate::serializers::deserialize_null_into_default\")]", | ||
); | ||
config.field_attribute( | ||
".pb.Span.traceID", | ||
"#[serde(default)] #[serde(deserialize_with = \"crate::serializers::deserialize_null_into_default\")]", | ||
); | ||
config.field_attribute( | ||
".pb.Span.spanID", | ||
"#[serde(default)] #[serde(deserialize_with = \"crate::serializers::deserialize_null_into_default\")]", | ||
); | ||
config.field_attribute( | ||
".pb.Span.parentID", | ||
"#[serde(default)] #[serde(deserialize_with = \"crate::serializers::deserialize_null_into_default\")]", | ||
); | ||
config.field_attribute( | ||
".pb.Span.start", | ||
"#[serde(default)] #[serde(deserialize_with = \"crate::serializers::deserialize_null_into_default\")]", | ||
); | ||
config.field_attribute( | ||
".pb.Span.duration", | ||
"#[serde(default)] #[serde(deserialize_with = \"crate::serializers::deserialize_duration\")]", | ||
); | ||
config.field_attribute( | ||
".pb.Span.meta", | ||
"#[serde(default)] #[serde(deserialize_with = \"crate::serializers::deserialize_null_into_default\")]", | ||
); | ||
config.field_attribute( | ||
".pb.Span.metrics", | ||
"#[serde(default)] #[serde(deserialize_with = \"crate::serializers::deserialize_null_into_default\")]", | ||
); | ||
config.field_attribute( | ||
".pb.Span.type", | ||
"#[serde(default)] #[serde(deserialize_with = \"crate::serializers::deserialize_null_into_default\")]", |
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 know we are only targeting duration, does it make sense to then apply it to everything if we weren't doing it before?
Or is this mainly because we might reject when any of these fields are empty?
What does this PR do?
Fixes a customer issue where they lose a span because the duration was negative for some reason. This causes an error like this today:
"from request body: Error deserializing trace from request body: invalid value: integer
18226454927103518912
, expected i64"Motivation
Got the error, found it was due to a negative duration. We do the same thing in the go agent
Additional Notes
Anything else we should know when reviewing?
How to test the change?
Describe here in detail how the change can be validated.