Ver Fonte

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
Pavel Punsky há 3 anos atrás
pai
commit
da2ae173c4
1 ficheiros alterados com 0 adições e 2 exclusões
  1. 0 2
      src/apps/relay/prom_server.c

+ 0 - 2
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) {
 void prom_inc_allocation(SOCKET_TYPE type) {
   if (turn_params.prometheus == 1){
   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)});
     prom_gauge_inc(turn_total_allocations, (const char*[]) {socket_type_name(type)});
   }
   }
 }
 }
 
 
 void prom_dec_allocation(SOCKET_TYPE type) {
 void prom_dec_allocation(SOCKET_TYPE type) {
   if (turn_params.prometheus == 1){
   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)});
     prom_gauge_dec(turn_total_allocations, (const char*[]) {socket_type_name(type)});
   }
   }
 }
 }