Skip to content

Conversation

@josecelano
Copy link
Member

@josecelano josecelano commented Jun 10, 2025

Fix Prometheus export to include only one HELP and TYPE lines per metric.

Current format:

# HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
# TYPE udp_tracker_server_connection_id_errors_total counter
udp_tracker_server_connection_id_errors_total{client_software_name="Other (BC)",client_software_version="0087"} 4
# HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
# TYPE udp_tracker_server_connection_id_errors_total counter
udp_tracker_server_connection_id_errors_total{client_software_name="Other (FD66)",client_software_version=""} 1
# HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
# TYPE udp_tracker_server_connection_id_errors_total counter
udp_tracker_server_connection_id_errors_total{client_software_name="Other (SP)",client_software_version="3605"} 631
# HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
# TYPE udp_tracker_server_connection_id_errors_total counter
udp_tracker_server_connection_id_errors_total{client_software_name="Other (TIX0325)",client_software_version=""} 14
# HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
# TYPE udp_tracker_server_connection_id_errors_total counter
udp_tracker_server_connection_id_errors_total{client_software_name="Other (BC)",client_software_version="0202"} 6754
# HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
# TYPE udp_tracker_server_connection_id_errors_total counter
udp_tracker_server_connection_id_errors_total{client_software_name="Other (XF)",client_software_version="9400"} 1
# HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
# TYPE udp_tracker_server_connection_id_errors_total counter
udp_tracker_server_connection_id_errors_total{client_software_name="Other (BC)",client_software_version="0090"} 7
# HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
# TYPE udp_tracker_server_connection_id_errors_total counter
udp_tracker_server_connection_id_errors_total{client_software_name="Transmission",client_software_version="2.32"} 1
# HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
# TYPE udp_tracker_server_connection_id_errors_total counter
udp_tracker_server_connection_id_errors_total{client_software_name="Other (61-b39e)",client_software_version=""} 1

Expected format:

# HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
# TYPE udp_tracker_server_connection_id_errors_total counter
udp_tracker_server_connection_id_errors_total{client_software_name="Other (BC)",client_software_version="0087"} 4
udp_tracker_server_connection_id_errors_total{client_software_name="Other (FD66)",client_software_version=""} 1
udp_tracker_server_connection_id_errors_total{client_software_name="Other (SP)",client_software_version="3605"} 631
udp_tracker_server_connection_id_errors_total{client_software_name="Other (TIX0325)",client_software_version=""} 14
udp_tracker_server_connection_id_errors_total{client_software_name="Other (BC)",client_software_version="0202"} 6754
udp_tracker_server_connection_id_errors_total{client_software_name="Other (XF)",client_software_version="9400"} 1
udp_tracker_server_connection_id_errors_total{client_software_name="Other (BC)",client_software_version="0090"} 7
udp_tracker_server_connection_id_errors_total{client_software_name="Transmission",client_software_version="2.32"} 1
udp_tracker_server_connection_id_errors_total{client_software_name="Other (61-b39e)",client_software_version=""} 1

A line break has also been added after each metric to improve readability.

…YPE header per metric

Current format:

```
 # HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
 # TYPE udp_tracker_server_connection_id_errors_total counter
 udp_tracker_server_connection_id_errors_total{client_software_name="Other (BC)",client_software_version="0087"} 4
 # HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
 # TYPE udp_tracker_server_connection_id_errors_total counter
 udp_tracker_server_connection_id_errors_total{client_software_name="Other (FD66)",client_software_version=""} 1
 # HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
 # TYPE udp_tracker_server_connection_id_errors_total counter
 udp_tracker_server_connection_id_errors_total{client_software_name="Other (SP)",client_software_version="3605"} 631
 # HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
 # TYPE udp_tracker_server_connection_id_errors_total counter
 udp_tracker_server_connection_id_errors_total{client_software_name="Other (TIX0325)",client_software_version=""} 14
 # HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
 # TYPE udp_tracker_server_connection_id_errors_total counter
 udp_tracker_server_connection_id_errors_total{client_software_name="Other (BC)",client_software_version="0202"} 6754
 # HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
 # TYPE udp_tracker_server_connection_id_errors_total counter
 udp_tracker_server_connection_id_errors_total{client_software_name="Other (XF)",client_software_version="9400"} 1
 # HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
 # TYPE udp_tracker_server_connection_id_errors_total counter
 udp_tracker_server_connection_id_errors_total{client_software_name="Other (BC)",client_software_version="0090"} 7
 # HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
 # TYPE udp_tracker_server_connection_id_errors_total counter
 udp_tracker_server_connection_id_errors_total{client_software_name="Transmission",client_software_version="2.32"} 1
 # HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
 # TYPE udp_tracker_server_connection_id_errors_total counter
 udp_tracker_server_connection_id_errors_total{client_software_name="Other (61-b39e)",client_software_version=""} 1
```

Expected format:

```
 # HELP udp_tracker_server_connection_id_errors_total Total number of requests with connection ID errors
 # TYPE udp_tracker_server_connection_id_errors_total counter
 udp_tracker_server_connection_id_errors_total{client_software_name="Other (BC)",client_software_version="0087"} 4
 udp_tracker_server_connection_id_errors_total{client_software_name="Other (FD66)",client_software_version=""} 1
 udp_tracker_server_connection_id_errors_total{client_software_name="Other (SP)",client_software_version="3605"} 631
 udp_tracker_server_connection_id_errors_total{client_software_name="Other (TIX0325)",client_software_version=""} 14
 udp_tracker_server_connection_id_errors_total{client_software_name="Other (BC)",client_software_version="0202"} 6754
 udp_tracker_server_connection_id_errors_total{client_software_name="Other (XF)",client_software_version="9400"} 1
 udp_tracker_server_connection_id_errors_total{client_software_name="Other (BC)",client_software_version="0090"} 7
 udp_tracker_server_connection_id_errors_total{client_software_name="Transmission",client_software_version="2.32"} 1
 udp_tracker_server_connection_id_errors_total{client_software_name="Other (61-b39e)",client_software_version=""} 1
```

A line break after each metric has also been added to improve readability.
@josecelano josecelano force-pushed the 1569-overhaul-stats-fix-prometheus-export-to-include-only-one-help-and-type-lines-per-metric branch from b04675e to 02433cb Compare June 10, 2025 18:36
@josecelano
Copy link
Member Author

ACK 02433cb

@josecelano josecelano self-assigned this Jun 10, 2025
@josecelano josecelano added Bug Incorrect Behavior - Admin - Enjoyable to Install and Setup our Software labels Jun 10, 2025
@codecov
Copy link

codecov bot commented Jun 10, 2025

Codecov Report

Attention: Patch coverage is 96.22642% with 2 lines in your changes missing coverage. Please review.

Project coverage is 83.85%. Comparing base (d7af961) to head (02433cb).
Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
packages/metrics/src/label/set.rs 83.33% 1 Missing ⚠️
packages/metrics/src/sample.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1574      +/-   ##
===========================================
- Coverage    83.88%   83.85%   -0.03%     
===========================================
  Files          284      284              
  Lines        20333    20318      -15     
  Branches     20333    20318      -15     
===========================================
- Hits         17056    17038      -18     
- Misses        2976     2979       +3     
  Partials       301      301              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@josecelano josecelano merged commit 0269c79 into torrust:develop Jun 10, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

- Admin - Enjoyable to Install and Setup our Software Bug Incorrect Behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overhaul stats: Fix Prometheus export to include only one HELP and TYPE lines per metric

1 participant