prometheus / prometheus/client_python
Discrepancy between metrics names in prometheus and metadata
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 4.4k
- Forks
- 876
- Ø Merge
- 8 T. 4 Std.
- Gemergte PRs (30 T.)
- 1
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit nachzuverfolgen, wie Counter-Namen normalisiert werden und wie Metadaten über /api/v1/metadata bereitgestellt werden, wobei die beiden Beispiele im Issue als Reproduktionen verwendet werden. Vergleiche den Prometheus-Expositionsnamen mit dem Metadatenschlüssel und füge Regressionstests hinzu, die eine konsistente Benennung für Counter zeigen, die mit und ohne das Suffix _total erstellt wurden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- prometheus, python
- Bereich
- observability-sre
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 40/100