bugfix: fix broken type label of turn_total_allocations gauge (#1119)

It's not working when constructing it in-place, likely this is undefined
behaviour.

Co-authored-by: Paul Kramer <paul.kramer@logmein.com>
This commit is contained in:
Paul Kramer 2022-12-09 03:04:28 +01:00 committed by GitHub
parent 82646a9023
commit 72e2605562
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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