aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenry Spanka <henry@spanka.eu>2024-10-18 10:08:56 +0200
committerHenry Spanka <henry@spanka.eu>2024-10-18 10:08:56 +0200
commit02db8749e5d6386d9cef91ad82e7220109261f04 (patch)
tree99bcfbce0d0364587edfd7987819586df8c21010
parent28302c84ef7c9ecdb4845b445d5ebba4c1ef204f (diff)
downloadrspamd-02db8749e5d6386d9cef91ad82e7220109261f04.tar.gz
rspamd-02db8749e5d6386d9cef91ad82e7220109261f04.zip
add EOF to openmetrics response in proxy and server
-rw-r--r--src/libserver/protocol.c1
-rw-r--r--src/rspamd_proxy.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c
index a86111ff2..73660114d 100644
--- a/src/libserver/protocol.c
+++ b/src/libserver/protocol.c
@@ -2091,6 +2091,7 @@ void rspamd_protocol_write_reply(struct rspamd_task *task, ev_tstamp timeout, st
memcpy(&stat_copy, srv->stat, sizeof(stat_copy));
output = rspamd_metrics_to_prometheus_string(
rspamd_worker_metrics_object(srv->cfg, &stat_copy, now - srv->start_time));
+ rspamd_printf_fstring(&output, "# EOF\n");
rspamd_http_message_set_body_from_fstring_steal(msg, output);
ctype = "application/openmetrics-text; version=1.0.0; charset=utf-8";
break;
diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c
index e2a866178..694e87c12 100644
--- a/src/rspamd_proxy.c
+++ b/src/rspamd_proxy.c
@@ -1768,6 +1768,7 @@ rspamd_proxy_scan_self_reply(struct rspamd_task *task)
memcpy(&stat_copy, session->ctx->srv->stat, sizeof(stat_copy));
output = rspamd_metrics_to_prometheus_string(
rspamd_worker_metrics_object(task->cfg, &stat_copy, ev_time() - session->ctx->srv->start_time));
+ rspamd_printf_fstring(&output, "# EOF\n");
rspamd_http_message_set_body_from_fstring_steal(msg, output);
ctype = "application/openmetrics-text; version=1.0.0; charset=utf-8";
break;