Repository navigation
Closed
Labels
DeploymentDeployment
Description
Deploy this PR.
Make sure, after the deployment, that the Grafana dashboard built from the stats endpoint looks identical to the Grafana dashboard built from the metrics endpoint.
{
"torrents": 550113,
"seeders": 265381,
"completed": 1199155,
"leechers": 439675,
"tcp4_connections_handled": 60,
"tcp4_announces_handled": 60,
"tcp4_scrapes_handled": 0,
"tcp6_connections_handled": 0,
"tcp6_announces_handled": 0,
"tcp6_scrapes_handled": 0,
"udp_requests_aborted": 294791,
"udp_requests_banned": 147544719,
"udp_banned_ips_total": 27520,
"udp_avg_connect_processing_time_ns": 1062774,
"udp_avg_announce_processing_time_ns": 3693051,
"udp_avg_scrape_processing_time_ns": 364937,
"udp4_requests": 1187265352,
"udp4_connections_handled": 466416196,
"udp4_announces_handled": 564501480,
"udp4_scrapes_handled": 5510353,
"udp4_responses": 1039479291,
"udp4_errors_handled": 6022753,
"udp6_requests": 0,
"udp6_connections_handled": 0,
"udp6_announces_handled": 0,
"udp6_scrapes_handled": 0,
"udp6_responses": 0,
"udp6_errors_handled": 0
}I've added some logs to verify that the new data in the endpoint is equal to the previous one. When you load the stats endpoint, it will show these warnings if the data is not equal:
2025-06-13T10:35:35.664925Z WARN request{method=GET uri=/api/v1/stats?token=MyAccessToken&format=prometheus version=HTTP/1.1}: torrust_rest_tracker_api_core::statistics::services: The protocol metrics from global metrics and labeled metrics are different
2025-06-13T10:35:35.664930Z WARN request{method=GET uri=/api/v1/stats?token=MyAccessToken&format=prometheus version=HTTP/1.1}: torrust_rest_tracker_api_core::statistics::services: Global metrics: ProtocolMetrics { tcp4_connections_handled: 1, tcp4_announces_handled: 1, tcp4_scrapes_handled: 0, tcp6_connections_handled: 0, tcp6_announces_handled: 0, tcp6_scrapes_handled: 0, udp_requests_aborted: 0, udp_requests_banned: 0, udp_banned_ips_total: 0, udp_avg_connect_processing_time_ns: 0, udp_avg_announce_processing_time_ns: 0, udp_avg_scrape_processing_time_ns: 0, udp4_requests: 0, udp4_connections_handled: 0, udp4_announces_handled: 0, udp4_scrapes_handled: 0, udp4_responses: 0, udp4_errors_handled: 0, udp6_requests: 0, udp6_connections_handled: 0, udp6_announces_handled: 0, udp6_scrapes_handled: 0, udp6_responses: 0, udp6_errors_handled: 0 }
2025-06-13T10:35:35.664936Z WARN request{method=GET uri=/api/v1/stats?token=MyAccessToken&format=prometheus version=HTTP/1.1}: torrust_rest_tracker_api_core::statistics::services: Labeled metrics: ProtocolMetrics { tcp4_connections_handled: 0, tcp4_announces_handled: 0, tcp4_scrapes_handled: 0, tcp6_connections_handled: 0, tcp6_announces_handled: 0, tcp6_scrapes_handled: 0, udp_requests_aborted: 0, udp_requests_banned: 0, udp_banned_ips_total: 0, udp_avg_connect_processing_time_ns: 0, udp_avg_announce_processing_time_ns: 0, udp_avg_scrape_processing_time_ns: 0, udp4_requests: 0, udp4_connections_handled: 0, udp4_announces_handled: 0, udp4_scrapes_handled: 0, udp4_responses: 0, udp4_errors_handled: 0, udp6_requests: 0, udp6_connections_handled: 0, udp6_announces_handled: 0, udp6_scrapes_handled: 0, udp6_responses: 0, udp6_errors_handled: 0 }
Metadata
Metadata
Assignees
Labels
DeploymentDeployment
Activity
josecelano commentedon Jun 13, 2025
Grafana dashboard before deployment:
josecelano commentedon Jun 13, 2025
After the deployment, the metrics for the
statsendpoint look good.Global metrics on the left, labeled metric on the right:
I'm getting the warning I added to detect differences but only in the average processing time in nanoseconds (which is normal and expected):
Warning example in logs:
Same data formatted:
Global metrics:
Labeled metrics:
Grafana dashboard after 10 minutes:
josecelano commentedon Jun 13, 2025
Overlaying the two dashboards (after 10m). I will do it again in a few hours.
josecelano commentedon Jun 13, 2025
The two Grafana dashboards after 1 hour:
Screencast.From.2025-06-13.18-30-03.webm
josecelano commentedon Jun 16, 2025
The two Grafana dashboards after 24 hours:
Screencast.From.2025-06-16.10-56-52.webm
cc @da2ce7