Skip to content

test: cover OTel metrics shutdown - #7606

Draft
bm1549 wants to merge 4 commits into
mainfrom
brian.marks/otel-metrics-lifecycle
Draft

test: cover OTel metrics shutdown#7606
bm1549 wants to merge 4 commits into
mainfrom
brian.marks/otel-metrics-lifecycle

Conversation

@bm1549

@bm1549 bm1549 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Motivation

Datadog needs shared coverage that proves provider shutdown exports pending OpenTelemetry metrics for short-lived services.

Changes

  • Verify shutdown exports one exact pending DELTA metric before returning.
  • Invoke shutdown through each language test apps actual or global OpenTelemetry MeterProvider.
  • Keep coverage enabled for Python, Go, Ruby, and Rust.
  • Gate Java from 1.67.0 and Node.js from 7.0.0 for their Datadog provider extensions.
  • Keep .NET excluded because it has no public provider shutdown; C++ and PHP retain their existing file-level exclusions.
  • Use a one-hour periodic interval, bounded provider and HTTP calls, forced process termination, and one final intake snapshot. The test has no sleeps or polling.

Companion PRs: Java #12317, Node.js #10023, and documentation #39515.

Validation

  • ./format.sh
  • Python compilation and targeted pytest collection
  • Python parametric shutdown test

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on your PR until CI passes.
  3. Mark it ready for review.
    • Test logic is modified: get a review from the RFC owner.
    • Framework or non-obvious usage is modified: get a review from R&P.

Reviewer checklist

  • Anything outside tests/ or manifests/ is modified: R&P approval is required.
  • No Docker base image is modified.
  • No scenario is added, removed, or renamed.

@bm1549 bm1549 added the ai-generated The pull request includes a significant amount of AI-generated code label Aug 27, 2026
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

manifests/dotnet.yml                                                    @DataDog/system-tests-reviewers
manifests/golang.yml                                                    @DataDog/system-tests-reviewers
manifests/java.yml                                                      @DataDog/system-tests-reviewers
manifests/nodejs.yml                                                    @DataDog/system-tests-reviewers
tests/parametric/test_otel_metrics.py                                   @DataDog/system-tests-core @DataDog/apm-sdk-capabilities
utils/build/docker/golang/parametric/helpers.go                         @DataDog/system-tests-reviewers
utils/build/docker/golang/parametric/main.go                            @DataDog/system-tests-reviewers
utils/build/docker/golang/parametric/otel_metrics.go                    @DataDog/system-tests-reviewers
utils/build/docker/java/parametric/src/main/java/com/datadoghq/trace/opentelemetry/controller/OpenTelemetryMetricsController.java  @DataDog/system-tests-reviewers
utils/build/docker/nodejs/parametric/server.js                          @DataDog/system-tests-reviewers
utils/build/docker/python/parametric/apm_test_client/server.py          @DataDog/system-tests-reviewers
utils/build/docker/ruby/parametric/server.rb                            @DataDog/system-tests-reviewers
utils/build/docker/rust/parametric/src/opentelemetry/mod.rs             @DataDog/system-tests-reviewers
utils/docker_fixtures/_test_clients/_test_client_parametric.py          @DataDog/system-tests-core

@datadog-official

datadog-official Bot commented Aug 27, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

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

@mabdinur
mabdinur force-pushed the brian.marks/otel-metrics-lifecycle branch 5 times, most recently from cdc4d02 to b2e03aa Compare September 1, 2026 21:47
@mabdinur
mabdinur force-pushed the brian.marks/otel-metrics-lifecycle branch from b2e03aa to 4282625 Compare September 1, 2026 22:08

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

Reviewed the deterministic lifecycle validation and SDK adapters. CI is green.

@mabdinur mabdinur changed the title test: cover OTel metrics ForceFlush and Shutdown test: cover OTel metrics shutdown Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated The pull request includes a significant amount of AI-generated code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants