prometheus / prometheus/client_python
Discrepancy between metrics names in prometheus and metadata
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 4.4k
- Forks
- 876
- Merge medio
- 8 d 4 h
- PR fusionados (30 d)
- 1
Descripción
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.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Empieza rastreando cómo se normalizan los nombres de Counter y cómo se expone metadata a través de /api/v1/metadata, usando los dos ejemplos del issue como reproducciones. Compara el nombre de exposición de Prometheus con la clave de metadata y añade cobertura de regresión que muestre una nomenclatura coherente para Counters creados con y sin el sufijo _total.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- prometheus, python
- Área
- observability-sre
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 40/100