From 6aed012b1f6c702dfd389aee6f98df81783f8524 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) Signed-off-by: Enderson Maia --- 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");