diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-10-20 02:42:24 +0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-20 02:42:24 +0600 |
commit | b7f870b6a4629be693eb4dc860fe0930a614a3dd (patch) | |
tree | 476ab37029dbebe72b6fab1f1649c0df9b5edba4 /src | |
parent | c9b804517d25168ed4c03c70fcc808d38b86e785 (diff) | |
parent | 02db8749e5d6386d9cef91ad82e7220109261f04 (diff) | |
download | rspamd-b7f870b6a4629be693eb4dc860fe0930a614a3dd.tar.gz rspamd-b7f870b6a4629be693eb4dc860fe0930a614a3dd.zip |
Merge pull request #5192 from henry-spanka/add-eof-to-openmetrics
add EOF to openmetrics response in proxy and server
Diffstat (limited to 'src')
-rw-r--r-- | src/libserver/protocol.c | 1 | ||||
-rw-r--r-- | src/rspamd_proxy.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index 7d007370b..2dc641dfe 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -2092,6 +2092,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; |