From 5d480614fae79127b7f9dd7f4bda11aa72aeb19f Mon Sep 17 00:00:00 2001 From: Enderson Maia Date: Mon, 27 May 2024 13:08:33 +0000 Subject: [PATCH] in_prometheus_scrape: add User-Agent HTTP header (#8880) --- plugins/in_prometheus_scrape/prom_scrape.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/in_prometheus_scrape/prom_scrape.c b/plugins/in_prometheus_scrape/prom_scrape.c index e6ddf20b6b8..ebba9414f36 100644 --- a/plugins/in_prometheus_scrape/prom_scrape.c +++ b/plugins/in_prometheus_scrape/prom_scrape.c @@ -107,6 +107,9 @@ static int collect_metrics(struct prom_scrape *ctx) flb_http_bearer_auth(c, ctx->bearer_token); } + /* Add User-Agent */ + flb_http_add_header(c, "User-Agent", 10, "Fluent-Bit", 10); + ret = flb_http_do(c, &b_sent); if (ret != 0) { flb_plg_error(ctx->ins, "http do error");