From 7285be2aabf4ba9915a23085e63efb896c5a8896 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Mon, 31 Jan 2022 16:16:13 -0800 Subject: prom: basic builtin prometheus stats exporter This is a vpp builtin alternative, not a replacement, for the existing vpp_prometheus_exporter. The plugin works by registering with http_static as a url handler for stats.prom and handles requests by scraping the stats segment in the main thread. It will therefore consume vpp process cpu cycles. By default the plugin is disabled. To enable, first start the http static server an then use "prom enable" cli. Type: feature Signed-off-by: Florin Coras Change-Id: If6888e965d1b2361f6a5546586068213d37079d1 --- src/plugins/http_static/static_server.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/plugins/http_static') diff --git a/src/plugins/http_static/static_server.c b/src/plugins/http_static/static_server.c index a9b3fdbb08a..bd231b44b47 100644 --- a/src/plugins/http_static/static_server.c +++ b/src/plugins/http_static/static_server.c @@ -300,6 +300,10 @@ hss_session_send_data (hss_url_handler_args_t *args) hss_session_t *hs; hs = hss_session_get (args->sh.thread_index, args->sh.session_index); + + if (hs->data && hs->free_data) + vec_free (hs->data); + hs->data = args->data; hs->data_len = args->data_len; hs->free_data = args->free_vec_data; -- cgit 1.2.3-korg