From da2ae173c46dc0f84734e9add44c6b37badf3050 Mon Sep 17 00:00:00 2001 From: Pavel Punsky Date: Sun, 6 Nov 2022 11:13:48 -0800 Subject: [PATCH] Fix duplicate prometheus metric report (#1079) Prometheus would aggregate across all labels (when not specifying) In this scenario `turn_total_allocations` does not need separate label "type=all" as such in this case the result would be double the actual amount --- src/apps/relay/prom_server.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/apps/relay/prom_server.c b/src/apps/relay/prom_server.c index 0e10103..55b88c1 100644 --- a/src/apps/relay/prom_server.c +++ b/src/apps/relay/prom_server.c @@ -131,14 +131,12 @@ void prom_set_finished_traffic(const char* realm, const char* user, unsigned lon void prom_inc_allocation(SOCKET_TYPE type) { if (turn_params.prometheus == 1){ - prom_gauge_inc(turn_total_allocations, (const char*[]) {"all"}); prom_gauge_inc(turn_total_allocations, (const char*[]) {socket_type_name(type)}); } } void prom_dec_allocation(SOCKET_TYPE type) { if (turn_params.prometheus == 1){ - prom_gauge_dec(turn_total_allocations, (const char*[]) {"all"}); prom_gauge_dec(turn_total_allocations, (const char*[]) {socket_type_name(type)}); } }