Skip to content

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

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

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

opentelemetry-pr-dashboard Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-11-12 02:49 UTC

Investigate required status check failures.

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.
  • Should this be with reviewers? Comment /dashboard route:reviewers to route it to them.
  • Anything wrong — including the routing? 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 89.90826% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.37%. Comparing base (53d860b) to head (83ae054).

Files with missing lines Patch % Lines
...emetry/sdk/metrics/internal/view/ViewRegistry.java 93.57% 7 Missing and 2 partials ⚠️
...y/sdk/common/internal/IncludeExcludePredicate.java 44.44% 2 Missing and 3 partials ⚠️
...k/metrics/internal/view/CompositeAndPredicate.java 81.48% 3 Missing and 2 partials ⚠️
...try/sdk/metrics/internal/SdkMeterProviderUtil.java 75.00% 2 Missing ⚠️
...figure/declarativeconfig/MeterProviderFactory.java 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9020      +/-   ##
============================================
+ Coverage     90.33%   90.37%   +0.03%     
- Complexity    11017    11080      +63     
============================================
  Files          1021     1023       +2     
  Lines         30124    30320     +196     
  Branches       3933     3974      +41     
============================================
+ Hits          27214    27403     +189     
+ Misses         1953     1949       -4     
- Partials        957      968      +11     

☔ 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.

@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
@rooks-ns
rooks-ns force-pushed the feat/composable-metric-views branch 2 times, most recently from 845fbfd to 6d78faf Compare November 11, 2026 20:22
@rooks-ns
rooks-ns marked this pull request as ready for review November 12, 2026 02:19
@rooks-ns
rooks-ns requested a review from a team as a code owner November 12, 2026 02:19
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 6d78faf to 83ae054 Compare November 12, 2026 02:23

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