Repository navigation
Use delta-preferred temporality in test exporters - #21111
Merged
Merged
Conversation
Pull request dashboard statusMerged · refreshed 2026-11-04 07:56 UTC Status above doesn't look right?
|
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Change shared test exporters' default to use deltaPreferred
Use delta-preferred temporality in test exporters
Oct 31, 2026
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the delta-preferred metric temporality changes.
No open issues 🎉
What changed in this PR
This PR aligns agent, library, and Spring starter test exporters with delta-preferred metric temporality: counters and histograms remain DELTA, while up-down counters become CUMULATIVE.
Changes:
- Applies delta-preferred defaults while preserving explicit agent temporality overrides.
- Adds instrument-level checks, repeated-collection assertions, and separate JVM tests for overrides.
- Documents the defaults, override setting, and compatibility change.
| File | Description |
|---|---|
| testing/agent-for-testing/src/test/java/io/opentelemetry/javaagent/testing/AgentMetricTemporalityTest.java | Tests default and configured temporality across instrument types. |
| testing/agent-for-testing/build.gradle.kts | Wires separate DELTA and CUMULATIVE test JVMs into check. |
| testing/agent-exporter/src/main/java/io/opentelemetry/javaagent/testing/exporter/OtlpInMemoryMetricExporter.java | Uses delta-preferred defaults while retaining explicit overrides. |
| testing-common/src/main/java/io/opentelemetry/instrumentation/testing/LibraryTestRunner.java | Adopts the shared delta-preferred exporter. |
| testing-common/src/main/java/io/opentelemetry/instrumentation/testing/internal/DeltaPreferredInMemoryMetricExporter.java | Adds a delegating exporter with an older-SDK compatibility fallback. |
| smoke-tests-otel-starter/spring-smoke-testing/src/main/java/io/opentelemetry/spring/smoketest/SpringSmokeTestRunner.java | Applies the shared exporter to Spring starter tests. |
| instrumentation/micrometer/micrometer-1.5/testing/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/AbstractLongTaskTimerTest.java | Checks temporality and observable up-down counter values across collections. |
| docs/contributing/javaagent-test-infra.md | Documents exporter defaults and agent overrides. |
| CHANGELOG.md | Records the testing-exporter behavior change. |
Review effort: Balanced
trask
reviewed
Oct 31, 2026
Co-authored-by: trask <218610+trask@users.noreply.github.com>
trask
reviewed
Oct 31, 2026
trask
reviewed
Oct 31, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: trask <218610+trask@users.noreply.github.com>
trask
reviewed
Oct 31, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: trask <218610+trask@users.noreply.github.com>
trask
marked this pull request as ready for review
October 31, 2026 22:21
trask
approved these changes
Oct 31, 2026
This was referenced Oct 31, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
laurit
approved these changes
Nov 4, 2026
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.
Use SDK delta-preferred temporality for shared library, javaagent, and Spring starter test exporters. Up-down counters are cumulative; counters, observable counters, and histograms remain DELTA.
An observable active-task count of
1, 1, 0now exports those values instead of1, 0, -1. This prevents the final zero assertion from matching a zero delta collected while a task was still active.Explicit
otel.javaagent.testing.exporter.temporality=DELTAand=CUMULATIVEretain their existing fixed-temporality behavior.Relates to #20794.