Module: kamailio Branch: 6.0 Commit: 2a9078378dc885a10f7b7a1471b4334b7d27001b URL: https://github.com/kamailio/kamailio/commit/2a9078378dc885a10f7b7a1471b4334b7d27001b
Author: Joel Serrano <[email protected]> Committer: Henning Westerholt <[email protected]> Date: 2025-12-12T06:56:46Z xhttp_prom: don't sanitize tag values in exported metrics (#4519) Fixes #4508 (cherry picked from commit 02f7ace19b49a16ccacc7d83f4717f6492ff56fa) --- Modified: src/modules/xhttp_prom/prom.c --- Diff: https://github.com/kamailio/kamailio/commit/2a9078378dc885a10f7b7a1471b4334b7d27001b.diff Patch: https://github.com/kamailio/kamailio/commit/2a9078378dc885a10f7b7a1471b4334b7d27001b.patch --- diff --git a/src/modules/xhttp_prom/prom.c b/src/modules/xhttp_prom/prom.c index a1aedcc7e0a..20bf6ffe428 100644 --- a/src/modules/xhttp_prom/prom.c +++ b/src/modules/xhttp_prom/prom.c @@ -191,14 +191,19 @@ static int metric_generate( (uint64_t)ts); /* Print metric name. */ - if(prom_body_name_printf(ctx, "%.*s%.*s_%.*s%s", xhttp_prom_beginning.len, - xhttp_prom_beginning.s, group->len, group->s, name->len, name->s, - xhttp_prom_tags_braces) + if(prom_body_name_printf(ctx, "%.*s%.*s_%.*s", xhttp_prom_beginning.len, + xhttp_prom_beginning.s, group->len, group->s, name->len, name->s) == -1) { LM_ERR("Fail to print\n"); return -1; } + /* xhttp_prom_tags_braces is not sanitized any more because UTF-8 characters are allowed */ + if(prom_body_printf(ctx, "%s", xhttp_prom_tags_braces) == -1) { + LM_ERR("Fail to print\n"); + return -1; + } + if(prom_body_printf(ctx, " %lu %" PRIu64 "\n", counter_val, (uint64_t)ts) == -1) { LM_ERR("Fail to print\n"); _______________________________________________ Kamailio - Development Mailing List -- [email protected] To unsubscribe send an email to [email protected] Important: keep the mailing list in the recipients, do not reply only to the sender!
