forked from coop-cloud/monitoring-ng
feat: bearer auth support
This commit is contained in:
@@ -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") "" }}
|
||||
|
||||
Reference in New Issue
Block a user