Skip to content

WIP feat(otel): Enable OTel semantics tests for Java weblog applications - #7919

Draft
zacharycmontoya wants to merge 4 commits into
mainfrom
zach.montoya/java-otel-http
Draft

zacharycmontoya wants to merge 4 commits into
mainfrom
zach.montoya/java-otel-http

Conversation

@zacharycmontoya

Copy link
Copy Markdown
Contributor

Motivation

The tests assert that the Datadog SDKs consistently emit the correct set of span attributes, span (resource) names, and span statuses when OTel semantics is enabled.

Changes

Overall, this PR runs the test cases in test_otel_http_semantics.py against dd-trace-java. Several other changes were needed to accomplish this:

  • Removes the _span_is_sampled check used in the OTEL_SEMANTICS_OTLP_SAMPLING_RULES. This check was intended to assert that spans were sampled, but this is unneeded because OTLP spans that are exported from the SDK, by definition, are sampled. This is not the case with MsgPack spans where all spans are sent to the local agent
  • Adds DD_METRICS_OTEL_ENABLED=true to the set of environment variables for the OTEL_SEMANTICS_OTLP_TRACE_METRICS scenario
  • Updates the GET /make_distant_call in all Java weblog applications to accept an optional method parameter, which is tested in the OTel HTTP Semantics test cases

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Tests, manifest, weblog are modified -> you'll need a review from system-tests-reviewers: ask to one of youre co-worker familiar with the tested feature.
    • Framework is modified, or non obvious usage of it -> get a review from system-tests-core (slack)

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Notes

This is intended to fail in the pull request CI because the changes are not merged, but they can be run locally with dev branches of dd-trace-java following the binaries.md documentation

…f a span is exported it is sampled.

For completeness, we should set the 32-bit flags field to match the value of the W3C traceparent flags field, but we don't need/use it right now.
…o accept an optional method argument, needed for OTel HTTP semantics
… set DD_METRICS_OTEL_ENABLED=true because we are configuring the metrics export with the OTEL_EXPORTER_OTLP_* environment variables
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

manifests/java.yml                                                      @DataDog/system-tests-reviewers
tests/test_otel_http_semantics.py                                       @DataDog/system-tests-reviewers
utils/_context/_scenarios/__init__.py                                   @DataDog/system-tests-core
utils/build/docker/java/akka-http/src/main/scala/com/datadoghq/akka_http/AppSecRoutes.scala  @DataDog/system-tests-reviewers
utils/build/docker/java/jersey-grizzly2/src/main/java/com/datadoghq/jersey/MyResource.java  @DataDog/system-tests-reviewers
utils/build/docker/java/play/app/controllers/AppSecController.scala     @DataDog/system-tests-reviewers
utils/build/docker/java/play/conf/routes                                @DataDog/system-tests-reviewers
utils/build/docker/java/ratpack/src/main/java/com/datadoghq/ratpack/Main.java  @DataDog/system-tests-reviewers
utils/build/docker/java/resteasy-netty3/src/main/java/com/datadoghq/resteasy/MyResource.java  @DataDog/system-tests-reviewers
utils/build/docker/java/spring-boot-3-native/src/main/java/com/datadoghq/springbootnative/WebController.java  @DataDog/system-tests-reviewers
utils/build/docker/java/spring-boot/src/main/java/com/datadoghq/system_tests/springboot/App.java  @DataDog/system-tests-reviewers
utils/build/docker/java/vertx3/src/main/java/com/datadoghq/vertx3/Main.java  @DataDog/system-tests-reviewers
utils/build/docker/java/vertx4/src/main/java/com/datadoghq/vertx4/Main.java  @DataDog/system-tests-reviewers

@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

✨ Unblock PR with BitsAI

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 2 Pipeline jobs failed

Testing the test | all-jobs-are-green — 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

Testing the test | lint / lint — 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

Useful? React with 👍 / 👎

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

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant