prometheus / prometheus/client_python

Feature request - public `registry._names_to_collectors` access

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

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

主要言語
Python
スター
4.4k
フォーク
876
平均マージ
8日 4時間
マージ済み PR(30日)
1

説明

Now we are working on Prometheus support in FastStream and faced with a problem. Shared registry between different middlewares leads to MetricsContainer duplication. So, we would like to have a public API to chech registry for already registered objects.

Can you please provide public access to this property some way?

https://github.com/prometheus/client_python/blob/master/prometheus_client/registry.py#L31

I think, the easiest way to save old API and provide us with a new one - add a public property like in the following snipper

class CollectorRegistry(Collector):
    def __init__(self):
        self._names_to_collectors: Dict[str, Collector] = {}

    @property
    def names_to_collectors(self):
        return self._names_to_collectors

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

issue でリンクされているとおり、prometheus_client/registry.py の CollectorRegistry とその _names_to_collectors プロパティから始めてください。registry がどのように使用されているかを確認し、公開アクセスによる互換性への影響を特定してください。既存の内部属性を削除せずに、登録されたオブジェクトを調査するためのサポートされた公開手段を提供できれば完了です。

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

評価

技術スタック
prometheus, python
領域
observability-sre
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

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

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