Skip to content

test: cover OTel metrics ForceFlush and Shutdown - #7606

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

test: cover OTel metrics ForceFlush and Shutdown#7606
bm1549 wants to merge 2 commits into
mainfrom
brian.marks/otel-metrics-lifecycle

Conversation

@bm1549

@bm1549 bm1549 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Motivation

Datadog's OTel metrics lifecycle support needs shared provider-level coverage without relying on process-exit hooks.

Changes

  • Prove force_flush and shutdown export one exact pending DELTA metric before returning.
  • Keep coverage enabled for Python, Go, Ruby, and Rust, whose existing public providers pass both tests.
  • Activate Java from v1.66.0 and Node.js from v7.0.0 for their Datadog lifecycle extensions.
  • Keep .NET excluded because it has no public provider shutdown; C++ and PHP retain file-level exclusions.
  • Use a one-hour periodic interval, bounded provider and HTTP calls, forced process termination, and one final intake snapshot. The tests contain no sleeps or polling.

Live runs passed 2/2 on Python 4.14.0, Go 2.10.1, Ruby 2.42.0, and Rust 0.5.2. Java 1.65.1 and Node.js 6.13.0 confirmed their release gates.

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

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/java/parametric/src/main/java/com/datadoghq/trace/opentelemetry/dto/FlushArgs.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 CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 4282625 | 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.

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