Add experimental view_matching_mode (composable metric views) support

未关闭
#9,013 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 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:

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_mode setter on SdkMeterProviderBuilder via SdkMeterProviderUtil (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 composable View grouping and stream merging in opentelemetry-sdk-metrics (ViewBuilder / View and ViewRegistry) per the specification:
    • Form a stream group for each distinct configured View name containing matching Views with that name plus all matching Views with name == null (or a single default-named group if no matching View sets name).
    • Track explicitly configured ViewBuilder properties (distinguishing unset properties from ViewBuilder's default field values in ViewBuilder.java#L26-L30) to apply atomic last-wins precedence across non-attribute_keys stream settings, falling back per-aspect to the preceding valid View in the group (or default) with a warning on semantic errors rather than discarding the entire RegisteredView.
    • Compose specified attribute_keys predicates via logical AND, and override instrument advisory parameters only for aspects configured by matching Views in the group (falling back to instrument advisory parameters otherwise).
  • Wire MeterProviderModelAccessor.getViewMatchingMode(model) in MeterProviderFactory.create(...).
Additional Context
主要语言
Java
星标
2.5k
派生
1k
平均合并
4 天 3 小时
30 天内合并 PR
52

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

open-telemetry/opentelemetry-java 的其他 Issue

查看 open-telemetry/opentelemetry-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。