prometheus / prometheus/client_python
Discrepancy between metrics names in prometheus and metadata
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 4.4k
- フォーク
- 876
- 平均マージ
- 8日 4時間
- マージ済み PR(30日)
- 1
説明
Hello,
When creating a Counter metric with client_python 0.4.0 - 0.16.0:
my_metric_count = Counter(name='my_metric_count',
documentation='My helpful description',
registry=MY_REGISTRY)
The metric will show in prometheus as my_metric_count_total. This is absolutely fine with the world however that same metric will show under http://prometheus:9090/api/v1/metadata as the original name:
"my_metric_count": [
{
"type": "counter",
"help": "My helpful description",
"unit": ""
}
],
If one creates the metric with '_total' suffix:
my_metric_count = Counter(name='my_metric_count_total',
documentation='My helpful description',
registry=MY_REGISTRY)
It will show in prometheus as that exact name my_metric_count_total but the name in the /api/v1/metadata will now be truncated.
"my_metric_count": [
{
"type": "counter",
"help": "My helpful description",
"unit": ""
}
],
This breaks certain input plugins with telegraf that rely on the prometheus metadata and remote write to fetch the metric type. Version of this library starting with 0.4.0 exhibit this behavior which is when metrics names began to be munged with '_total' for compatibility with OpenMetrics.
Thank you.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、Counter 名がどのように正規化され、metadata が /api/v1/metadata を通じてどのように公開されるかを、issue の 2 つの例を再現として使って追跡します。Prometheus の exposition name と metadata key を比較し、_total サフィックスありとなしで作成された Counter について一貫した命名を示すリグレッションカバレッジを追加します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- prometheus, python
- 領域
- observability-sre
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 40/100