Skip to content

Use delta-preferred temporality in test exporters - #21111

Merged
laurit merged 7 commits into
mainfrom
copilot/change-default-temporality
Nov 4, 2026
Merged

laurit merged 7 commits into
mainfrom
copilot/change-default-temporality

Conversation

Copilot AI commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

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, 0 now exports those values instead of 1, 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=DELTA and =CUMULATIVE retain their existing fixed-temporality behavior.

Relates to #20794.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-11-04 07:56 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

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
Copilot AI requested a review from trask October 31, 2026 19:27
@trask
trask requested a balanced review from Copilot October 31, 2026 19:29

Copilot AI 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.

🟢 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

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI requested a review from trask October 31, 2026 20:47
@trask
trask requested a balanced review from Copilot October 31, 2026 20:50

Copilot AI 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.

🟢 Approval recommended

No active review issues are recorded for the test-exporter temporality changes.

No open issues 🎉

Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI requested a review from trask October 31, 2026 21:23
@trask
trask requested a balanced review from Copilot October 31, 2026 21:24

Copilot AI 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.

🟢 Approval recommended

No active review issues are reported for the test-exporter temporality changes.

No open issues 🎉

Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI requested a review from trask October 31, 2026 22:11
@trask
trask requested a balanced review from Copilot October 31, 2026 22:12

Copilot AI 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.

🟢 Approval recommended

No active review issues block the test-exporter temporality update.

No open issues 🎉

Review effort: Balanced

@trask
trask marked this pull request as ready for review October 31, 2026 22:21
@trask
trask requested a review from a team as a code owner October 31, 2026 22:21
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI 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.

🟢 Approval recommended

The test-exporter temporality change has no active review issues.

No open issues 🎉

Review effort: Balanced

@laurit
laurit merged commit 92bfd79 into main Nov 4, 2026
69 checks passed
@laurit
laurit deleted the copilot/change-default-temporality branch November 4, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants