Skip to content

feat(metrics): add composable metric views support - #9020

Draft
rooks-ns wants to merge 1 commit into
open-telemetry:mainfrom
rooks-ns:feat/composable-metric-views
Draft

rooks-ns wants to merge 1 commit into
open-telemetry:mainfrom
rooks-ns:feat/composable-metric-views

Conversation

@rooks-ns

@rooks-ns rooks-ns commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Implement experimental composable view matching mode according to the OpenTelemetry Metrics SDK specification and declarative config schema.

  • Introduce ViewMatchingMode (INDEPENDENT, COMPOSABLE).
  • Track explicit View properties in ViewBuilder, View, and RegisteredView to distinguish configured fields from defaults.
  • Implement composable view resolution in ViewRegistry: stream grouping by configured name, last-wins attribute/cardinality merging, backward-scanning aggregation compatibility fallback, and attribute filter conjunction.
  • Add reflection bridge in SdkMeterProviderUtil to safely configure ViewMatchingMode on SdkMeterProviderBuilder without modifying public 1.x APIs.
  • Wire view_matching_mode/development in MeterProviderFactory for declarative configuration.
  • Add comprehensive unit and integration tests.

Fixes #9013

@otelbot otelbot Bot added the api-change Changes to public API surface area label Nov 8, 2026
@opentelemetry-pr-dashboard

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-11-08 06:46 UTC

Move out of draft to request review.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.05525% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.38%. Comparing base (f02bddc) to head (71baf95).

Files with missing lines Patch % Lines
...emetry/sdk/metrics/internal/view/ViewRegistry.java 92.85% 7 Missing and 2 partials ⚠️
...try/sdk/metrics/internal/SdkMeterProviderUtil.java 65.21% 8 Missing ⚠️
...figure/declarativeconfig/MeterProviderFactory.java 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9020      +/-   ##
============================================
+ Coverage     90.35%   90.38%   +0.03%     
- Complexity    11017    11071      +54     
============================================
  Files          1021     1022       +1     
  Lines         30128    30290     +162     
  Branches       3933     3966      +33     
============================================
+ Hits          27221    27377     +156     
+ Misses         1953     1951       -2     
- Partials        954      962       +8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Implement experimental composable view matching mode according to the OpenTelemetry Metrics SDK specification and declarative config schema.

- Introduce ViewMatchingMode (INDEPENDENT, COMPOSABLE).
- Track explicit View properties in ViewBuilder, View, and RegisteredView to distinguish configured fields from defaults.
- Implement composable view resolution in ViewRegistry: stream grouping by configured name, last-wins attribute/cardinality merging, backward-scanning aggregation compatibility fallback, and attribute filter conjunction.
- Add reflection bridge in SdkMeterProviderUtil to safely configure ViewMatchingMode on SdkMeterProviderBuilder without modifying public 1.x APIs.
- Wire view_matching_mode/development in MeterProviderFactory for declarative configuration.
- Add comprehensive unit and integration tests.

Fixes open-telemetry#9013
@rooks-ns
rooks-ns force-pushed the feat/composable-metric-views branch from 5b4722c to 71baf95 Compare November 9, 2026 14:39
@otelbot otelbot Bot removed the api-change Changes to public API surface area label Nov 9, 2026
@dashpole
dashpole self-requested a review November 9, 2026 18:11

This branch has not been deployed

No deployments
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.

Add experimental view_matching_mode (composable metric views) support

1 participant