prometheus / prometheus/client_python
OpenMetrics support for textfile collector
オープン
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 4.4k
- フォーク
- 876
- 平均マージ
- 8日 4時間
- マージ済み PR(30日)
- 1
説明
Currently prometheus_client.exposition.write_to_textfile doesn't support the OpenMetrics text format, which I'm addressing with this (private) hack:
from prometheus_client.openmetrics.exposition import (
generate_latest as generate_latest_openmetrics,
)
from prometheus_client.registry import CollectorRegistry
def write_openmetrics_to_textfile(path: str, registry: CollectorRegistry) -> None:
"""
Fork of `prometheus_client.exposition.write_to_textfile`, as the project
didn't provide an OpenMetrics variant of this helper function.
"""
with open(path, "wb") as fp:
fp.write(generate_latest_openmetrics(registry))
Would your project be interested in a non-hacky (as is the case above) OpenMetrics support for textfile collector?
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
prometheus_client.exposition.write_to_textfile から始め、その動作を prometheus_client.openmetrics.exposition.generate_latest と比較します。既存のテキストファイル collector の動作を維持しながら、helper が OpenMetrics 出力をどのように公開すべきかを判断します。提供された registry に対してサポート対象の helper が有効な OpenMetrics テキストを書き込み、プロジェクトの関連テストでカバーされていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- observability
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100