prometheus mtls working

This commit is contained in:
John Lancaster
2025-12-28 20:17:04 -06:00
parent 015725d2cc
commit 0fb52c50ff
4 changed files with 36 additions and 25 deletions

View File

@@ -4,6 +4,7 @@
prometheus.exporter.cadvisor "docker_metrics" {
docker_host = "unix:///var/run/docker.sock"
storage_duration = "5m"
allowlisted_container_labels = ["name", "container", "container_name", "id"]
}
prometheus.scrape "scraper" {
@@ -15,7 +16,12 @@ prometheus.scrape "scraper" {
prometheus.remote_write "default" {
endpoint {
url = "http://prometheus:9090/api/v1/write"
url = "https://prometheus.john-stream.com:9090/api/v1/write"
tls_config {
cert_file = "/etc/alloy/certs/prometheus.crt"
key_file = "/etc/alloy/certs/prometheus.key"
ca_file = "/etc/alloy/certs/root_ca.crt"
}
}
}
@@ -23,27 +29,27 @@ discovery.docker "linux" {
host = "unix:///var/run/docker.sock"
}
discovery.relabel "logs_integrations_docker" {
targets = []
// discovery.relabel "logs_integrations_docker" {
// targets = []
rule {
source_labels = ["__meta_docker_container_name"]
regex = "/(.*)"
target_label = "service_name"
}
}
// rule {
// source_labels = ["__meta_docker_container_name"]
// regex = "/(.*)"
// target_label = "service_name"
// }
// }
loki.source.docker "default" {
host = "unix:///var/run/docker.sock"
targets = discovery.docker.linux.targets
labels = {"platform" = "docker"}
relabel_rules = discovery.relabel.logs_integrations_docker.rules
forward_to = [loki.write.default.receiver]
}
// loki.source.docker "default" {
// host = "unix:///var/run/docker.sock"
// targets = discovery.docker.linux.targets
// labels = {"platform" = "docker"}
// relabel_rules = discovery.relabel.logs_integrations_docker.rules
// forward_to = [loki.write.default.receiver]
// }
loki.write "default" {
endpoint {
url = "http://loki:3100/loki/api/v1/push"
}
external_labels = {}
}
// loki.write "default" {
// endpoint {
// url = "http://loki:3100/loki/api/v1/push"
// }
// external_labels = {}
// }