Module: kamailio
Branch: master
Commit: 57dd65c2c6abd520c0db876aca6bd2238229e187
URL:
https://github.com/kamailio/kamailio/commit/57dd65c2c6abd520c0db876aca6bd22…
Author: Ovidiu Sas <osas(a)voipembedded.com>
Committer: Ovidiu Sas <osas(a)voipembedded.com>
Date: 2024-04-04T16:22:39Z
xhttp_prom: use proper prefix for pkg stats
---
Modified: src/modules/xhttp_prom/prom.c
---
Diff:
https://github.com/kamailio/kamailio/commit/57dd65c2c6abd520c0db876aca6bd22…
Patch:
https://github.com/kamailio/kamailio/commit/57dd65c2c6abd520c0db876aca6bd22…
---
diff --git a/src/modules/xhttp_prom/prom.c b/src/modules/xhttp_prom/prom.c
index 1ea7edb1c5e..786a2c3e40a 100644
--- a/src/modules/xhttp_prom/prom.c
+++ b/src/modules/xhttp_prom/prom.c
@@ -221,8 +221,9 @@ static int prom_metric_pkgmem_print(prom_ctx_t *ctx)
for(; i < pkg_proc_stats_no; i++) {
if(prom_body_printf(ctx,
- "kamailio_pkgmem_used{pid=\"%u\", rank=\"%d\",
desc=\"%s\"} "
+ "%.*spkgmem_used{pid=\"%u\", rank=\"%d\",
desc=\"%s\"} "
"%d %" PRIu64 "\n",
+ xhttp_prom_beginning.len, xhttp_prom_beginning.s,
pkg_proc_stats[i].pid, pkg_proc_stats[i].rank, pt[i].desc,
pkg_proc_stats[i].used, ts)
== -1) {
@@ -230,8 +231,9 @@ static int prom_metric_pkgmem_print(prom_ctx_t *ctx)
goto error;
}
if(prom_body_printf(ctx,
- "kamailio_pkgmem_available{pid=\"%u\", rank=\"%d\",
"
+ "%.*spkgmem_available{pid=\"%u\", rank=\"%d\", "
"desc=\"%s\"} %d %" PRIu64 "\n",
+ xhttp_prom_beginning.len, xhttp_prom_beginning.s,
pkg_proc_stats[i].pid, pkg_proc_stats[i].rank, pt[i].desc,
pkg_proc_stats[i].available, ts)
== -1) {
@@ -239,8 +241,9 @@ static int prom_metric_pkgmem_print(prom_ctx_t *ctx)
goto error;
}
if(prom_body_printf(ctx,
- "kamailio_pkgmem_real_used{pid=\"%u\", rank=\"%d\",
"
+ "%.*spkgmem_real_used{pid=\"%u\", rank=\"%d\", "
"desc=\"%s\"} %d %" PRIu64 "\n",
+ xhttp_prom_beginning.len, xhttp_prom_beginning.s,
pkg_proc_stats[i].pid, pkg_proc_stats[i].rank, pt[i].desc,
pkg_proc_stats[i].real_used, ts)
== -1) {
@@ -248,8 +251,9 @@ static int prom_metric_pkgmem_print(prom_ctx_t *ctx)
goto error;
}
if(prom_body_printf(ctx,
- "kamailio_pkgmem_total_frags{pid=\"%u\", rank=\"%d\",
"
+ "%.*spkgmem_total_frags{pid=\"%u\", rank=\"%d\", "
"desc=\"%s\"} %d %" PRIu64 "\n",
+ xhttp_prom_beginning.len, xhttp_prom_beginning.s,
pkg_proc_stats[i].pid, pkg_proc_stats[i].rank, pt[i].desc,
pkg_proc_stats[i].total_frags, ts)
== -1) {
@@ -257,8 +261,9 @@ static int prom_metric_pkgmem_print(prom_ctx_t *ctx)
goto error;
}
if(prom_body_printf(ctx,
- "kamailio_pkgmem_total_size{pid=\"%u\", rank=\"%d\"
"
+ "%.*spkgmem_total_size{pid=\"%u\", rank=\"%d\" "
"desc=\"%s\"} %d %" PRIu64 "\n",
+ xhttp_prom_beginning.len, xhttp_prom_beginning.s,
pkg_proc_stats[i].pid, pkg_proc_stats[i].rank, pt[i].desc,
pkg_proc_stats[i].total_size, ts)
== -1) {