Repository navigation
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Pull request dashboard statusWaiting on reviewers · refreshed 2026-11-02 21:10 UTC Review the latest changes. Status above doesn't look right?
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the temporality-selector factory change.
No open issues 🎉
What changed in this PR
Adds instrument-specific temporality selection to InMemoryMetricExporter, allowing tests to use selectors such as deltaPreferred() without a custom exporter wrapper.
Changes:
- Adds a selector-based factory while preserving the behavior of existing factories.
- Expands tests for temporality selection, null-selector rejection, metric collection, and exported-data preservation.
- Updates the API compatibility report to record the new overload.
| File | Description |
|---|---|
sdk/testing/src/test/java/io/opentelemetry/sdk/testing/exporter/InMemoryMetricExporterTest.java |
Tests selector behavior and preserves coverage of existing factories. |
sdk/testing/src/main/java/io/opentelemetry/sdk/testing/exporter/InMemoryMetricExporter.java |
Adds the selector factory and delegates temporality selection to it. |
docs/apidiffs/current_vs_latest/opentelemetry-sdk-testing.txt |
Records the new public factory overload. |
Review effort: Balanced
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8993 +/- ##
============================================
+ Coverage 90.36% 90.38% +0.01%
- Complexity 10995 10996 +1
============================================
Files 1020 1020
Lines 30096 30098 +2
Branches 3929 3929
============================================
+ Hits 27197 27203 +6
+ Misses 1942 1937 -5
- Partials 957 958 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Related to open-telemetry/opentelemetry-java-instrumentation#21111
Allow
InMemoryMetricExporterto accept anAggregationTemporalitySelector, so tests can select temporality by instrument type without a custom exporter wrapper.This uses delta temporality for counters and histograms while keeping up-down counters cumulative.
Existing factories retain their behavior:
create()uses cumulative temporality for all instruments, andcreate(AggregationTemporality)applies the given temporality to every instrument type.