]> source.dussan.org Git - rspamd.git/commitdiff
add EOF to openmetrics response in proxy and server
authorHenry Spanka <henry@spanka.eu>
Fri, 18 Oct 2024 08:08:56 +0000 (10:08 +0200)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sun, 20 Oct 2024 09:05:18 +0000 (10:05 +0100)
src/libserver/protocol.c
src/rspamd_proxy.c

index a86111ff22dbf0cbed65176b98023cbe97367aee..73660114d211af5179f6c9b7c2687bb09a781570 100644 (file)
@@ -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;
index e2a8661783b8f2d28340c1118da15f6bd81f021c..694e87c12adf401afe8390f9bdee8d3b8470c891 100644 (file)
@@ -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;