prometheus / prometheus/client_python

Histogram without label creates histogram_*.db even without data

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

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

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

説明

I tried this with versions: 0.19.0 and 0.20.0, both seem to have this bug.

I have a script prom_example.py:

from prometheus_client import Histogram

Example = Histogram("example", "Example", "lol")

When I run it:

prometheus_multiproc_dir=/tmp/metrics python prom_example.py

I see nothing in /tmp/metrics (as expected).

But when I edit the script and remove the label from histogram:

from prometheus_client import Histogram

Example = Histogram("example", "Example")

Database is created is /tmp/metrics, named for example: histogram_37373.db I would expect no database creation, since no data is pushed into the metric.

Edit: it seems the behaviour is the same for Counter and Gauge

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

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

はじめの一歩

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

調査の方向性

ラベルなしの Histogram を使用し、prom_example.py スクリプトと prometheus_multiproc_dir で問題を再現してから、ラベルありの場合と比較します。Histogram、Counter、Gauge の初期化パスを確認します。完了条件は、メトリクスデータが記録される前に .db ファイルが作成されないことです。

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

評価

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

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

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