Repository navigation
Add span event assertions to smoke tests - #12934
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Legacy event decoding accepts trailing JSON garbage, so smoke assertions can pass on malformed serialized events. The parser needs to consume the complete document, including the JSON-null path.
🤖 Bits Code Review · Commit 804af45
This comment has been minimized.
This comment has been minimized.
804af45 to
cc04271
Compare
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
sarahchen6
left a comment
There was a problem hiding this comment.
Looks reasonable!
cc @AlexeyKuznetsov-DD if you want to take a look
AlexeyKuznetsov-DD
left a comment
There was a problem hiding this comment.
LGTM, left some comments, can be applied as follow ups if they make sense.
|
View all feedbacks in Devflow UI.
It will be processed automatically as soon as GitHub reports it as mergeable. View in MergeQueue UI.
bruce.bujon@datadoghq.com unqueued this merge request |
|
/merge -c |
|
View all feedbacks in Devflow UI.
|
|
I'll have a look a look at the feedback first :) |
@PerfectSlayer Sorry, I triggered it by mistake, thanks for canceling it. |
cc04271 to
f2f17f5
Compare
What Does This Do
Adds span event assertions to smoke tests, mirroring span links:
Decoder (
utils/test-agent-utils/decoder)DecodedSpan.getEvents()exposes decoded span events (name, time, typed attributes) for every protocol:v0.4/v0.5msgpackeventsmeta tagv0.4tracer payloadeventsmeta tag, kept as-is by the agentv1.0tracer payloadspan_eventsfield, with typed attribute valuesv1.0msgpackAttribute values decode to
String,Boolean,Long,Double, or aListof them, whatever the source and malformed events fail decoding with an explicit error, as malformed links do.Smoke DSL (
dd-smoke-tests)SpanEventMatcher:event(name),.time(...),.attributes(...). By default, an event has no attribute and its time is within the span bounds.SpanMatcher.events(...)matches events positionally and count-exact;events()asserts none, and not calling it asserts nothing, likelinks(...).OpenTelemetrySmokeTestnow asserts.events(event("configuration-loaded"))instead of searching theeventstag string.Motivation
Smoke tests could only check events by inspecting the
eventstag string, which does not exist with thev1.0protocol where events are structured. This aligns smoke tests with the JUnit trace assertions (#12810).Additional Notes
v1.0decoder used to skip field 12 blindly, which consumed any string the events introduced without registering it, desynchronizing the string table for the rest of the payload. It now decodes the events through the string table.span_eventsshape was captured from a real dd-apm-test-agent (v1.64.1) run and is kept as thespan-events-v1.jsonfixture.Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]
🤖 Generated with Claude Code