Skip to content

Conversation

michelhe
Copy link
Contributor

Following #596

The Prometheus exporter now properly appends the _total suffix to counter metric names in both help text and type declarations, ensuring consistency with Prometheus naming conventions.

This also makes the python prometheus_client.parser.text_string_to_metric_families parse the metrics better.

Even though not mandatory by the exposition format, I've seen the prometheus go client append these suffixes to both HELP and TYPE lines. For example see:

docker run -d --rm -p 9090:9090 prom/prometheus
curl http://localhost:9090/metrics

@michelhe michelhe force-pushed the fix-prometheus-help branch from 889ce62 to 61354e4 Compare July 23, 2025 14:28
@michelhe michelhe force-pushed the fix-prometheus-help branch from 61354e4 to a20e2f7 Compare July 23, 2025 15:18
The Prometheus exporter now properly appends the _total suffix to counter
metric names in both help text and type declarations, ensuring consistency
with Prometheus naming conventions.

This also makes the python `prometheus_client.parser.text_string_to_metric_families`
parse the metrics better.

Even though not mandatory by the exposition format, I've seen the prometheus
go client append these suffixes to both HELP and TYPE lines. For example see:

```bash
docker run -d --rm -p 9090:9090 prom/prometheus
curl http://localhost:9090/metrics
```

Signed-off-by: Michel Heily <michelheily@gmail.com>
@tobz tobz added C-exporter Component: exporters such as Prometheus, TCP, etc. E-simple Effort: simple. T-bug Type: bug. labels Jul 31, 2025
@tobz tobz merged commit 2d99f82 into metrics-rs:main Jul 31, 2025
13 checks passed
@tobz tobz added the S-awaiting-release Status: awaiting a release to be considered fixed/implemented. label Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-exporter Component: exporters such as Prometheus, TCP, etc. E-simple Effort: simple. S-awaiting-release Status: awaiting a release to be considered fixed/implemented. T-bug Type: bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants