From 64cb07a4a25e6201d5cbcb59e5e887792c9fb45e Mon Sep 17 00:00:00 2001 From: f Date: Tue, 16 Jun 2026 20:03:17 -0300 Subject: [PATCH] feat: bearer auth support --- config.alloy.tmpl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/config.alloy.tmpl b/config.alloy.tmpl index d050502..3bff4ce 100644 --- a/config.alloy.tmpl +++ b/config.alloy.tmpl @@ -124,6 +124,15 @@ discovery.relabel "metrics_basicauth" { } } +discovery.relabel "metrics_bearerauth" { + targets = discovery.relabel.metrics.output + rule { + source_labels = ["__meta_docker_container_label_prometheus_io_auth"] + regex = "bearer" + action = "keep" + } +} + prometheus.scrape "containers" { scrape_interval = "120s" targets = discovery.relabel.metrics_noauth.output @@ -139,6 +148,13 @@ prometheus.scrape "containers_basicauth" { password = "{{ secret "basic_auth" }}" } } + +prometheus.scrape "containers_bearerauth" { + scrape_interval = "120s" + targets = discovery.relabel.metrics_bearerauth.output + forward_to = [prometheus.remote_write.prometheus.receiver] + bearer_token = "{{ secret "basic_auth" }}" +} {{ end }} {{ if ne (env "LOKI_PUSH_URL") "" }}