Skip to content

Fix metrics-api JaCoCo coverage gate - #12456

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
masterfrom
dougqh/metrics-api-jacoco-coverage
Sep 21, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
masterfrom
dougqh/metrics-api-jacoco-coverage

Conversation

@dougqh

@dougqh dougqh commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

What Does This Do

  • products/metrics/metrics-api never opted into the excludedClassesCoverage convention used by sibling modules, so the repo-wide 0.9 minimum instruction/branch coverage rule failed for every NoOp* class as soon as CI ran this module's full check task (module-scoped CI hadn't run a full check here in a while).
  • Excludes the true no-op classes (NoOpCounter, NoOpHistogram, NoOpHistogramsFactory, NoOpMonitoring, NoOpRecording, NoOpStatsDClient) and the pure-interface Monitoring.
  • Adds the module's first src/test tree with real unit tests for the classes that have actual untested logic: Histograms (registration + static factory dispatch), StatsDClientManager (default 5-arg overload delegating to the 6-arg one), Recording (close() delegates to stop()), and a small StatsDClient test to clear its default recordEvent method.

Motivation

Unrelated to any in-flight feature work — this is a pre-existing coverage gap surfaced while working on #12351, which switched metrics-api's build.gradle.kts to the dd-trace-java.module.internal-api plugin and newly exposed the module to this gate. Kept as its own PR rather than folded into #12351, since the two are independent and shouldn't be reviewed together.

Additional Notes

  • Test plan:
    • ./gradlew :products:metrics:metrics-api:test
    • ./gradlew :products:metrics:metrics-api:jacocoTestCoverageVerification
    • ./gradlew :products:metrics:metrics-api:check

Contributor Checklist

  • Format the title according to the contribution guidelines
  • Assign the type: and (comp: or inst:) labels in addition to any other useful labels
  • Avoid using close, fix, or any linking keywords when referencing an issue
  • Update the CODEOWNERS file on source file addition, migration, or deletion (n/a — no new top-level source areas)
  • Update public documentation with any new configuration flags or behaviors (n/a — no config/behavior change)
  • Once approved, use merge queue to merge the PR

Jira ticket: none — pre-existing gap found incidentally, not tracked separately

🤖 Generated with Claude Code

The module never opted into the excludedClassesCoverage convention
used by sibling modules, so the repo-wide 0.9 minimum instruction/
branch coverage rule failed for every NoOp* class as soon as CI ran
this module's full check task. Exclude the true no-op classes and
add real unit tests for the classes with actual logic (Histograms
registration/dispatch, StatsDClientManager's default overload,
Recording.close() delegating to stop()).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dougqh dougqh added type: bug fix Bug fix tag: no release notes Changes to exclude from release notes comp: metrics Metrics tag: ai generated Largely based on code generated by an AI or LLM labels Sep 11, 2026
@datadog-datadog-us1-prod

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Sep 11, 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.97 s 13.94 s [-0.6%; +1.0%] (no difference)
startup:insecure-bank:tracing:Agent 12.91 s 12.98 s [-1.3%; +0.2%] (no difference)
startup:petclinic:appsec:Agent 17.12 s 17.04 s [-0.4%; +1.3%] (no difference)
startup:petclinic:iast:Agent 16.99 s 16.55 s [-1.7%; +7.0%] (no difference)
startup:petclinic:profiling:Agent 16.83 s 16.87 s [-1.4%; +1.0%] (no difference)
startup:petclinic:sca:Agent 17.01 s 16.95 s [-0.6%; +1.5%] (no difference)
startup:petclinic:tracing:Agent 16.20 s 16.28 s [-1.4%; +0.5%] (no difference)

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

@dougqh
dougqh marked this pull request as ready for review September 11, 2026 11:30
@dougqh
dougqh requested review from a team as code owners September 11, 2026 11:30
@dougqh
dougqh requested review from amarziali and mhlidd and removed request for a team September 11, 2026 11:30

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

Datadog Autotest: PASS

More details

The coverage exclusions match the no-op and interface classes. The new tests cover the remaining default and factory behavior.

Was this helpful? React 👍 or 👎

Open Bits AI session

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

@dougqh
dougqh enabled auto-merge September 17, 2026 15:35
@dougqh
dougqh disabled auto-merge September 17, 2026 15:35
@dougqh
dougqh enabled auto-merge September 17, 2026 15:35
@dougqh
dougqh added this pull request to the merge queue Sep 21, 2026
@dd-octo-sts

dd-octo-sts Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-09-21 15:46:21 UTC ℹ️ Start processing command /merge


2026-09-21 15:46:26 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-09-21 17:34:08 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 21, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 86550b1 into master Sep 21, 2026
606 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the dougqh/metrics-api-jacoco-coverage branch September 21, 2026 17:34
@github-actions github-actions Bot added this to the 1.67.0 milestone Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: metrics Metrics tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants