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") "" }}