Add experimental view_matching_mode (composable metric views) support

オープン
#9,013 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
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時間
マージ済み PR(30日)
52

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

open-telemetry/opentelemetry-java のほかの issue

open-telemetry/opentelemetry-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。