otel.sdk.processor.{span,log}.queue.capacity uses synchronous UpDownCounter recorded once in __init__

オープン 初心者向け
#5,891 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

  • #5902 @2Zest による — マージされずにクローズ

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python

調査の方向性

opentelemetry-sdk/src/opentelemetry/sdk/_shared_internal/_processor_metrics.pyを読み、特にProcessorMetrics.__init__とregister_queue_sizeを確認してください。既存のキューサイズのobservableコールバックがどのように登録されているかを調べ、同期的な容量測定と比較してください。spanキューとlogキューの容量メトリクスがobservableコールバックを使用し、meter providerの登録後も、Deltaの収集サイクルを通じて利用できる状態であれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Description

In ProcessorMetrics.__init__, otel.sdk.processor.span.queue.capacity and otel.sdk.processor.log.queue.capacity are created as synchronous UpDownCounter instruments and recorded once during __init__:

https://github.com/open-telemetry/opentelemetry-python/blob/66ec88357e964dfda9b225975afc0d87ae4e95bb/opentelemetry-sdk/src/opentelemetry/sdk/_shared_internal/_processor_metrics.py#L93-L95

This causes queue.capacity to be missing in two common scenarios:

  1. When BatchSpanProcessor or BatchLogRecordProcessor is constructed before metrics.set_meter_provider(...) is called (including in opentelemetry-instrument auto-instrumentation), get_meter_provider() returns _ProxyMeterProvider, whose _ProxyUpDownCounter.add() is a no-op and does not replay measurements when the real MeterProvider is registered.
  2. When the MetricReader uses Delta aggregation temporality for UpDownCounter, the single .add(capacity) call in __init__ is only reported on the first collection cycle and is missing from all subsequent collections.
Expected behavior

otel.sdk.processor.span.queue.capacity and otel.sdk.processor.log.queue.capacity should be registered as asynchronous ObservableUpDownCounter callbacks (matching register_queue_size on lines 97-117).

主要言語
Python
スター
2.7k
フォーク
1.1k
平均マージ
4日 13分
マージ済み PR(30日)
38

環境構築

はじめの一歩

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

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

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

似ている issue

Python の issue をもっと見る

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

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