Skip to content

Add span event matcher to JUnit trace assertions - #12810

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
bbujon/span-events-assert
Oct 13, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
bbujon/span-events-assert

Conversation

@PerfectSlayer

@PerfectSlayer PerfectSlayer commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

What Does This Do

Adds a SpanEventMatcher to the JUnit trace assertions, mirroring SpanLinkMatcher:

span()
    .tags(defaultTags(), tag(SPAN_KIND, is(SPAN_KIND_INTERNAL)))
    .events(
        event("event1").time(TIME_NANO, NANOSECONDS),
        event("event2").attributes(singletonMap("string-key", "string-value")))
  • event(name) matches an event that has no attributes and a time within the span start and end times.
  • .time(timestamp, unit) and .attributes(Map) replace these defaults.
  • span().events(...) expects the same number of events, in the same order, like links(...).
  • defaultTags() accepts the events tag, as it already does for _dd.span_links.

OpenTelemetry14Test now asserts structured events and links instead of decoding the JSON of the events and _dd.span_links tags. As a result, the jsonassert test dependency is removed.

Motivation

Span events are now structured in core, and the events tag is only their v0.4/v0.5 encoding.
Tests should assert span data, not a protocol detail.

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

🤖 Generated with Claude Code

@PerfectSlayer PerfectSlayer added comp: testing Testing tag: no release notes Changes to exclude from release notes type: refactoring inst: opentelemetry OpenTelemetry instrumentation tag: ai generated Largely based on code generated by an AI or LLM labels Oct 9, 2026
@PerfectSlayer
PerfectSlayer added this pull request to stack #12809 October 9, 2026 10:14
@PerfectSlayer PerfectSlayer removed the inst: opentelemetry OpenTelemetry instrumentation label Oct 9, 2026
@PerfectSlayer
PerfectSlayer marked this pull request as ready for review October 9, 2026 10:15
@PerfectSlayer
PerfectSlayer requested review from a team as code owners October 9, 2026 10:15
@PerfectSlayer
PerfectSlayer requested review from AlexeyKuznetsov-DD and jordan-wong and removed request for a team October 9, 2026 10:15
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T10:19:13.151306Z 3515e49 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-09T10:18:11.971642Z 3515e49 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3515e494d4

ℹ️ 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".

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

The event matcher’s defaults and ordered, exact-count checks are consistent with the structured span data used by the migrated OpenTelemetry assertions.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 3515e49 · @DataDog review to ask questions

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 68.82% (+9.32%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 4f318a7 | Docs | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 13.95 s 13.96 s [-0.9%; +0.8%] (no difference)
startup:insecure-bank:tracing:Agent 12.87 s 13.00 s [-1.8%; -0.2%] (maybe better)
startup:petclinic:appsec:Agent 17.18 s 16.48 s [-0.2%; +8.7%] (no difference)
startup:petclinic:iast:Agent 16.90 s 17.03 s [-1.6%; +0.1%] (no difference)
startup:petclinic:profiling:Agent 16.71 s 16.63 s [-0.4%; +1.4%] (no difference)
startup:petclinic:sca:Agent 16.58 s 16.91 s [-6.2%; +2.2%] (no difference)
startup:petclinic:tracing:Agent 16.08 s 15.98 s [-0.3%; +1.6%] (no difference)

Commit: 4f318a7c · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much better than ugly strings with JSONs!

@PerfectSlayer
PerfectSlayer force-pushed the bbujon/span-events-assert branch 2 times, most recently from 2a6eeaf to efd35e6 Compare October 12, 2026 17:23
Base automatically changed from bbujon/span-process-tags to master October 12, 2026 19:45
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot removed the request for review from a team October 12, 2026 19:45

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

The event matcher and migrated OpenTelemetry assertions align with structured span data. Static review found that the metadata-processing flags preserve existing serializer behavior.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit efd35e6

@PerfectSlayer
PerfectSlayer force-pushed the bbujon/span-events-assert branch from efd35e6 to 4f318a7 Compare October 13, 2026 05:10
@PerfectSlayer

Copy link
Copy Markdown
Collaborator Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-10-13 05:39:58 UTC ℹ️ Start processing command /merge


2026-10-13 05:40:07 UTC ℹ️ MergeQueue: Pull request is not mergeable yet

It will be processed automatically as soon as GitHub reports it as mergeable. View in MergeQueue UI.

  • Run /code blockers to see what is blocking it.
  • Run /remove to cancel it.

2026-10-13 06:05:18 UTC ℹ️ MergeQueue: merge request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-10-13 07:20:06 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 85be893 into master Oct 13, 2026
628 of 630 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the bbujon/span-events-assert branch October 13, 2026 07:19
@github-actions github-actions Bot added this to the 1.68.0 milestone Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: testing Testing tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants