metrics: add experimental view_matching_mode (composable metric views) support
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 30/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
Start with opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/metric_reader_storage.py and metrics/_internal/__init__.py, then read the matching logic in _handle_view_instrument_match and the MeterProvider configuration path. Review the linked specification sections and the related View implementation before deciding how to cover matching, precedence, attribute filters, and advisory parameters. Done means opt-in composable matching is implemented with the specified fallback and error behavior, while independent mode 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 wildcard View that filters attribute_keys 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-sdk, MetricReaderStorage._handle_view_instrument_match(...) always evaluates matching Views independently, creating a separate _ViewInstrumentMatch stream for each matching View:
- https://github.com/open-telemetry/opentelemetry-python/blob/66ec88357e964dfda9b225975afc0d87ae4e95bb/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/metric_reader_storage.py#L233-L258
- https://github.com/open-telemetry/opentelemetry-python/blob/66ec88357e964dfda9b225975afc0d87ae4e95bb/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/__init__.py#L433-L455
Proposal
Implement experimental support for view_matching_mode ("independent" default, "composable" opt-in) in opentelemetry-sdk:
- Accept an experimental keyword-only
_view_matching_modeparameter onMeterProvider.__init__(...)(following_meter_configuratorinmetrics/_internal/__init__.py#L440-L441) and thread it intoSdkConfiguration/MetricReaderStorage, handling unsupported values persdk.md#L179-L182(either raisingValueErrorduring initialization or warning and falling back to"independent"). - When
composablemode is configured:- Form a stream group for each distinct configured
Viewnamecontaining matchingViews with thatnameplus all matchingViews withname=None(or a single default-named group if no matchingViewsetsname). - Apply atomic last-wins precedence in registration order across explicitly specified non-
attribute_keysViewsettings (name,description,aggregation,exemplar_reservoir_factory,aggregation_cardinality_limit, andenabledfrom https://github.com/open-telemetry/opentelemetry-python/pull/5847 — distinguishing omittedNonearguments foraggregationandexemplar_reservoir_factoryinview.py#L165-L166from explicit defaults such asDefaultAggregation()), falling back per-aspect to the preceding validViewin the group (or default) with a warning on semantic errors rather than discarding the entireView. - Combine specified
attribute_keysfilters via logical AND (set intersection across non-Noneallow-lists onmain; exclude-lists tracked in https://github.com/open-telemetry/opentelemetry-python/issues/5446), 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
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 (can be wired in
opentelemetry-configuration_meter_provider.py#L622-L667once schema models are regenerated for v1.2.0) - Reference Go prototype: https://github.com/open-telemetry/opentelemetry-go/pull/8510
- Related Python PR (
_opt_in_advisoryandViewenabledparameter): https://github.com/open-telemetry/opentelemetry-python/pull/5847
- 主要言語
- Python
- スター
- 2.7k
- フォーク
- 1.1k
- 平均マージ
- 3日 12時間
- マージ済み PR(30日)
- 16
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
open-telemetry/opentelemetry-python のほかの issue
-
References to Archived open-telemetry/oteps対応中かも @RjyavardhanSingh が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
open-telemetry/opentelemetry-python#5984 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Autoconfiguration rejects OTEL_EXPORTER_OTLP_PROTOCOL=http/json対応中かも @WendeelMarinho が 2 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
open-telemetry/opentelemetry-python#5981 ·
メンテナーはふだん 2 日以内に返信
-
MeterProvider raises ValueError on empty or uppercase OTEL_METRICS_EXEMPLAR_FILTER対応中かも @bishalde が 8 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
open-telemetry/opentelemetry-python#5948 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
W3CBaggagePropagator drops a list-member over 4096 bytes that W3C Baggage requires it to propagate対応中かも @codedbyadiiii が 20 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
open-telemetry/opentelemetry-python#5913 ·
メンテナーはふだん 2 日以内に返信
-
otel.sdk.processor.{span,log}.queue.capacity uses synchronous UpDownCounter recorded once in __init__再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
open-telemetry/opentelemetry-python#5891 ·
メンテナーはふだん 2 日以内に返信
open-telemetry/opentelemetry-python の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
Bforartists/Manual#1916 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
JdeRobot/PerceptionMetrics#698 ·
メンテナーはふだん 6 日以内に返信
-
good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
rootsiemen/seo-agent-tools#70 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
stephrobert/dsoxlab#413 ·
メンテナーはふだん 1 日以内に返信
-
format:line_indent keeps the second of two consecutive blank lines, so valid stairs fail対応中かも @albertlieyingadrian が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100