Add experimental view_matching_mode (composable metric views) support
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- java
调研方向
Start with ViewRegistry.findViews(...) in sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/view/ViewRegistry.java, then read the specification sections linked in the issue for stream grouping and merging rules. Inspect ViewBuilder and View for configured-property tracking, and SdkMeterProviderUtil for the experimental setter pattern; wire MeterProviderModelAccessor.getViewMatchingMode(model) from MeterProviderFactory.create(...). Done means composable matching, precedence, attribute filtering, and advisory fallback follow the specification while independent remains the default.
由索引模型根据 Issue 内容生成。
描述
Description
The OpenTelemetry Metrics SDK specification defines an experimental (Development) view_matching_mode configuration parameter (independent vs. composable) on MeterProvider to compose multiple matching Views (for example, combining a broad policy View that filters attributes or disables instruments with an instrument-specific View that customizes aggregation) into merged metric streams rather than emitting duplicate/conflicting streams (specification/metrics/sdk.md#L519-L543, introduced in https://github.com/open-telemetry/opentelemetry-specification/pull/5173).
Currently in opentelemetry-java:
ViewRegistry.findViews(...)only implementsindependentmatching, evaluating each matchingViewas a separate stream: https://github.com/open-telemetry/opentelemetry-java/blob/f02bddc4091f56d68b60b4c433afcec64c8d97b9/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/view/ViewRegistry.java#L99-L155opentelemetry-sdk-extension-declarative-config(:sdk-extensions:declarative-config) includes theview_matching_mode/developmentmodel accessor (MeterProviderModelAccessor.getViewMatchingMode), butMeterProviderFactory.create(...)does not yet wire it toSdkMeterProviderBuilder:- https://github.com/open-telemetry/opentelemetry-java/blob/f02bddc4091f56d68b60b4c433afcec64c8d97b9/sdk-extensions/declarative-config/src/main/java/io/opentelemetry/sdk/autoconfigure/declarativeconfig/model/internal/MeterProviderModelAccessor.java#L52-L58
- https://github.com/open-telemetry/opentelemetry-java/blob/f02bddc4091f56d68b60b4c433afcec64c8d97b9/sdk-extensions/declarative-config/src/main/java/io/opentelemetry/sdk/autoconfigure/declarativeconfig/MeterProviderFactory.java#L40-L107
Proposal
Implement experimental support for view_matching_mode (independent default, composable opt-in) in opentelemetry-sdk-metrics and wire it in opentelemetry-sdk-extension-declarative-config:
- Expose an experimental
view_matching_modesetter onSdkMeterProviderBuilderviaSdkMeterProviderUtil(following the pattern in https://github.com/open-telemetry/opentelemetry-java/blob/f02bddc4091f56d68b60b4c433afcec64c8d97b9/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/SdkMeterProviderUtil.java#L70-L84). - Implement
composableView grouping and stream merging inopentelemetry-sdk-metrics(ViewBuilder/ViewandViewRegistry) per the specification:- Form a stream group for each distinct configured
Viewnamecontaining matchingViews with thatnameplus all matchingViews withname == null(or a single default-named group if no matchingViewsetsname). - Track explicitly configured
ViewBuilderproperties (distinguishing unset properties fromViewBuilder's default field values inViewBuilder.java#L26-L30) to apply atomic last-wins precedence across non-attribute_keysstream settings, falling back per-aspect to the preceding validViewin the group (or default) with a warning on semantic errors rather than discarding the entireRegisteredView. - Compose specified
attribute_keyspredicates via logical AND, and override instrument advisory parameters only for aspects configured by matchingViews in the group (falling back to instrument advisory parameters otherwise).
- Form a stream group for each distinct configured
- Wire
MeterProviderModelAccessor.getViewMatchingMode(model)inMeterProviderFactory.create(...).
Additional Context
- Specification PR: https://github.com/open-telemetry/opentelemetry-specification/pull/5173 (open clarification PR: https://github.com/open-telemetry/opentelemetry-specification/pull/5414)
- Specification stabilization tracking issue: https://github.com/open-telemetry/opentelemetry-specification/issues/5385
- Declarative configuration schema PR: https://github.com/open-telemetry/opentelemetry-configuration/pull/666
- Reference Go prototype: https://github.com/open-telemetry/opentelemetry-go/pull/8510
- Related Java PR (
OptIninstrument advice andViewenabledconfiguration): https://github.com/open-telemetry/opentelemetry-java/pull/8979
- 主要语言
- Java
- 星标
- 2.5k
- 派生
- 1k
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 52
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
open-telemetry/opentelemetry-java 的其他 Issue
-
PrometheusComponentProvider promotes all resource attributes when resource_constant_labels is empty ({})可能已有人在做 @rooks-ns 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
open-telemetry/opentelemetry-java#9014 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
open-telemetry/opentelemetry-java#9011 ·
维护者通常 2 天内回复
-
Fix `otel.sdk.log.created` counting semantics可能已有人在做 @anuraaga 于 93 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
open-telemetry/opentelemetry-java#8688 ·
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 68/100
open-telemetry/opentelemetry-java#9012 ·
维护者通常 2 天内回复
-
SimpleLogRecordProcessor/SimpleSpanProcessor.forceFlush() result never completes when an export completes while ofAll() counts the pending set可能已有人在做 @nikhilred2619 于 4 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 62/100
open-telemetry/opentelemetry-java#8995 · 3 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
查看 open-telemetry/opentelemetry-java 的全部 Issue
相似的 Issue
-
bug web-ui
难度 2/5 1-3 小时 新手友好度 67/100
jenkinsci/jenkins#27705 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 80/100
googleads/googleads-mobile-flutter#1541 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
Julow/Unexpected-Keyboard#1490 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
Vakore/ZappierGames#275 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
unitycatalog/unitycatalog#2148 ·
维护者通常 2 天内回复