Skip to content

Migrate OpenTelemetry smoke test to JUnit - #12127

Open
PerfectSlayer wants to merge 2 commits into
masterfrom
bbujon/smoke-tests-opentelemetry
Open

Migrate OpenTelemetry smoke test to JUnit#12127
PerfectSlayer wants to merge 2 commits into
masterfrom
bbujon/smoke-tests-opentelemetry

Conversation

@PerfectSlayer

@PerfectSlayerPerfectSlayer commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

What Does This Do

This PR migrates the OpenTelemetry smoke tests to the new JUnit smoke test framework.

Motivation

The new tests checks the whole trace structures and span values, in addition to trace payload validity and invariants.

Additional Notes

Contributor Checklist

Jira ticket: APMLP-1247

@PerfectSlayerPerfectSlayer added the type: feature Enhancements and improvements label Aug 3, 2026
@PerfectSlayer
PerfectSlayer requested a review from a team as a code ownerAugust 3, 2026 13:26
@PerfectSlayerPerfectSlayer added the tag: no release notes Changes to exclude from release notes label Aug 3, 2026
@PerfectSlayer
PerfectSlayer requested review from mtoffl01 and removed request for a teamAugust 3, 2026 13:26
@PerfectSlayerPerfectSlayer added the inst: opentelemetry OpenTelemetry instrumentation label Aug 3, 2026

@datadog-datadog-prod-us1-2datadog-datadog-prod-us1-2Bot 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.

Datadog Autotest: PASS

More details

The JUnit migration preserves the OpenTelemetry smoke application launch and validates its one annotated trace plus ten sequential manual traces with the new backend assertions. No diff-only behavioral regression was confirmed; no additional tests recommended because the existing application shape is deterministic and the attempted module execution was blocked by unavailable Gradle/JDK tooling.

Was this helpful? React 👍 or 👎

📊 Validated against 3 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit 9eece4a · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@chatgpt-codex-connectorchatgpt-codex-connectorBot 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:9eece4ad18

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

@dd-octo-sts

dd-octo-stsBot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

SuiteStatus
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
ScenarioCandidatemasterΔ (95% CI of mean)
startup:insecure-bank:iast:Agent14.89 s14.76 s[+0.0%; +1.8%] (maybe worse)
startup:insecure-bank:tracing:Agent13.60 s13.74 s[-1.7%; -0.3%] (maybe better)
startup:petclinic:appsec:Agent16.40 s16.64 s[-5.7%; +2.8%] (no difference)
startup:petclinic:iast:Agent16.90 s16.88 s[-0.7%; +1.0%] (no difference)
startup:petclinic:profiling:Agent16.71 s16.88 s[-2.3%; +0.2%] (no difference)
startup:petclinic:sca:Agent16.24 s16.56 s[-6.4%; +2.4%] (no difference)
startup:petclinic:tracing:Agent16.04 s16.09 s[-1.2%; +0.6%] (no difference)

Commit:bb1762be · 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.

@PerfectSlayer
PerfectSlayer requested a review from a team as a code ownerAugust 4, 2026 11:30
@PerfectSlayer
PerfectSlayerforce-pushed the bbujon/smoke-tests-opentelemetry branch 2 times, most recently from e3bc1dc to f9175c8CompareAugust 4, 2026 11:32
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 58.15% (-0.47%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: bb1762b | Docs | View more details | Give us feedback!

@PerfectSlayer
PerfectSlayerforce-pushed the bbujon/smoke-tests-opentelemetry branch from f9175c8 to 36e7755CompareAugust 5, 2026 15:48
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Bits has a CI fix ready

🟢 Investigated · 🟢 Fix prepared · ⚪ Validation skipped · 🟠 Ready

OpenTelemetrySmokeTest assumed trace delivery order when validating the annotated and manual OpenTelemetry spans. It now uses UNORDERED matching so the test validates all expected traces without depending on their arrival order.

Commit fix to this PR


View in Datadog | Reviewed commit 36e7755 · Any feedback? Reach out in #deveng-pr-agent

@PerfectSlayer
PerfectSlayerforce-pushed the bbujon/smoke-tests-opentelemetry branch 2 times, most recently from 13ba721 to 97b671fCompareAugust 6, 2026 11:47
@PerfectSlayer
PerfectSlayerforce-pushed the bbujon/smoke-tests-opentelemetry branch from 97b671f to 54741a2CompareAugust 7, 2026 08:13
@PerfectSlayer
PerfectSlayerforce-pushed the bbujon/smoke-tests-opentelemetry branch from 54741a2 to 5eaac9aCompareAugust 11, 2026 09:55
@PerfectSlayerPerfectSlayer added tag: no release notes Changes to exclude from release notes and removed tag: no release notes Changes to exclude from release notes labels Aug 12, 2026
@PerfectSlayer
PerfectSlayerforce-pushed the bbujon/smoke-tests-opentelemetry branch from 5eaac9a to 7f045dfCompareAugust 13, 2026 12:33

@sarahchen6sarahchen6 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.

👍

Comment on lines +35 to +45
trace(span().root().operationName("Application.annotatedSpan")),
trace(span().root().resourceName("span-0")),
trace(span().root().resourceName("span-1")),
trace(span().root().resourceName("span-2")),
trace(span().root().resourceName("span-3")),
trace(span().root().resourceName("span-4")),
trace(span().root().resourceName("span-5")),
trace(span().root().resourceName("span-6")),
trace(span().root().resourceName("span-7")),
trace(span().root().resourceName("span-8")),
trace(span().root().resourceName("span-9")));

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.

nit: Looks like a copy-paste
Can we think of some more elegant checks?

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.

Indeed, in the groovy equivalent it was waitForTraceCount(11), but this method's use is a tad pervasive, I found 152 callsites.

Also there's a Traces::waitForTraceCount method, shouldn't it be used ?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

Can we think of some more elegant checks?

This come from the trace structure that is useless and not representing anything meanful.
The goal would be more to exercice the OTel API to build meaningful traces, which should give more elegant assert rules.

But it feels out of scope for this PR. The PR now checks the resource names, which is still a win compared to tho original trace count only.

Also there's a Traces::waitForTraceCount method, shouldn't it be used ?

The goal is to move to stricter trace structure testing. Trace count won't check for the format.
I expect to refine the test app behavior to something more meaningful so I only have basic test asserts for now.

Comment on lines +16 to +19
com.fasterxml.jackson.core:jackson-annotations:2.10.3=testCompileClasspath,testRuntimeClasspath
com.github.docker-java:docker-java-api:3.4.2=testCompileClasspath,testRuntimeClasspath
com.github.docker-java:docker-java-transport-zerodep:3.4.2=testCompileClasspath,testRuntimeClasspath
com.github.docker-java:docker-java-transport:3.4.2=testCompileClasspath,testRuntimeClasspath

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.

Just curious why lock file changed?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

This might come from the addition of test containers. I regenerated and the content seems up-to-date.

@bric3bric3 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 good to me, however I think the comment on assertTrace and the list of spans deserves some attention.

Comment on lines +35 to +45
trace(span().root().operationName("Application.annotatedSpan")),
trace(span().root().resourceName("span-0")),
trace(span().root().resourceName("span-1")),
trace(span().root().resourceName("span-2")),
trace(span().root().resourceName("span-3")),
trace(span().root().resourceName("span-4")),
trace(span().root().resourceName("span-5")),
trace(span().root().resourceName("span-6")),
trace(span().root().resourceName("span-7")),
trace(span().root().resourceName("span-8")),
trace(span().root().resourceName("span-9")));

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.

Indeed, in the groovy equivalent it was waitForTraceCount(11), but this method's use is a tad pervasive, I found 152 callsites.

Also there's a Traces::waitForTraceCount method, shouldn't it be used ?

@PerfectSlayer
PerfectSlayer requested a review from a team as a code ownerAugust 20, 2026 16:15
@PerfectSlayer
PerfectSlayerforce-pushed the bbujon/smoke-tests-opentelemetry branch from 7f045df to 8808628CompareAugust 20, 2026 16:15

@datadog-datadog-prod-us1-2datadog-datadog-prod-us1-2Bot 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.

Datadog Autotest: PASS

More details

The JUnit test keeps the prior check for 11 traces and exit value 0. It also checks each trace and span with the new smoke test framework.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Datadog Autotest · Commit 8808628 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@bm1549
bm1549 removed the request for review from mtoffl01August 20, 2026 20:35
@PerfectSlayer
PerfectSlayerforce-pushed the bbujon/smoke-tests-opentelemetry branch from 8808628 to b88ff9eCompareAugust 21, 2026 06:24
@PerfectSlayer
PerfectSlayerforce-pushed the bbujon/smoke-tests-opentelemetry branch from b88ff9e to 921c1ccCompareAugust 21, 2026 08:10
@PerfectSlayer
PerfectSlayerforce-pushed the bbujon/smoke-tests-opentelemetry branch from 921c1cc to 24d9a52CompareAugust 21, 2026 08:48
@PerfectSlayer
PerfectSlayerforce-pushed the bbujon/smoke-tests-opentelemetry branch from 24d9a52 to bb1762bCompareAugust 21, 2026 11:27
Base automatically changed from bbujon/smoke-tests-junit-framework to masterAugust 21, 2026 12:22

@datadog-datadog-prod-us1-2datadog-datadog-prod-us1-2Bot 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.

Datadog Autotest: PASS

More details

The JUnit migration preserves the 11 expected OpenTelemetry traces and the zero exit code check. The shared smoke-test framework has no reportable static correctness issue.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Datadog Autotest · Commit bb1762b · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: opentelemetryOpenTelemetry instrumentationtag: no release notesChanges to exclude from release notestype: featureEnhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@PerfectSlayer@bric3@sarahchen6@AlexeyKuznetsov-DD