Fix metrics-api JaCoCo coverage gate - #12456
Open
dougqh wants to merge 1 commit into
Open
Conversation
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>
This comment has been minimized.
This comment has been minimized.
Contributor
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
dougqh
marked this pull request as ready for review
September 11, 2026 11:30
dougqh
requested review from
amarziali and
mhlidd
and removed request for
a team
September 11, 2026 11:30
There was a problem hiding this comment.
More details
The coverage exclusions match the no-op and interface classes. The new tests cover the remaining default and factory behavior.
🤖 Datadog Autotest · Commit be114a1 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
products/metrics/metrics-apinever opted into theexcludedClassesCoverageconvention used by sibling modules, so the repo-wide 0.9 minimum instruction/branch coverage rule failed for everyNoOp*class as soon as CI ran this module's fullchecktask (module-scoped CI hadn't run a fullcheckhere in a while).NoOpCounter,NoOpHistogram,NoOpHistogramsFactory,NoOpMonitoring,NoOpRecording,NoOpStatsDClient) and the pure-interfaceMonitoring.src/testtree 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 tostop()), and a smallStatsDClienttest to clear its defaultrecordEventmethod.Motivation
Unrelated to any in-flight feature work — this is a pre-existing coverage gap surfaced while working on #12351, which switched
metrics-api'sbuild.gradle.ktsto thedd-trace-java.module.internal-apiplugin 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
./gradlew :products:metrics:metrics-api:test./gradlew :products:metrics:metrics-api:jacocoTestCoverageVerification./gradlew :products:metrics:metrics-api:checkContributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueJira ticket: none — pre-existing gap found incidentally, not tracked separately
🤖 Generated with Claude Code