Module: kamailio
Branch: 5.8
Commit: 7a3326c9d0663eb44a912b39065f60783b475697
URL: 
https://github.com/kamailio/kamailio/commit/7a3326c9d0663eb44a912b39065f60783b475697

Author: Joel Serrano <[email protected]>
Committer: Henning Westerholt <[email protected]>
Date: 2025-12-12T06:57:01Z

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/7a3326c9d0663eb44a912b39065f60783b475697.diff
Patch: 
https://github.com/kamailio/kamailio/commit/7a3326c9d0663eb44a912b39065f60783b475697.patch

---

diff --git a/src/modules/xhttp_prom/prom.c b/src/modules/xhttp_prom/prom.c
index 5ddcf3e9345..19a4f979843 100644
--- a/src/modules/xhttp_prom/prom.c
+++ b/src/modules/xhttp_prom/prom.c
@@ -194,6 +194,12 @@ static int metric_generate(
                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!

Reply via email to