prometheus mtls working
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
.env*
|
||||
.env*
|
||||
certs/
|
||||
0
certs/.gitkeep
Normal file
0
certs/.gitkeep
Normal file
@@ -12,9 +12,13 @@ services:
|
||||
image: grafana/alloy
|
||||
container_name: grafana-alloy
|
||||
restart: unless-stopped
|
||||
privileged: true
|
||||
volumes:
|
||||
- ./grafana-alloy/config.alloy:/etc/alloy/config.alloy
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ./grafana-alloy/config.alloy:/etc/alloy/config.alloy
|
||||
- ./certs:/etc/alloy/certs
|
||||
ports:
|
||||
- '12345:12345'
|
||||
command:
|
||||
- run
|
||||
- --server.http.listen-addr=0.0.0.0:12345
|
||||
@@ -33,7 +37,7 @@ services:
|
||||
WATCHTOWER_SCHEDULE: "0 0 3 * * *"
|
||||
|
||||
docker-proxy:
|
||||
image: ghcr.io/tecnativa/docker-socket-proxy:latest
|
||||
image: ghcr.io/tecnativa/docker-socket-proxy
|
||||
container_name: docker-proxy
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
|
||||
@@ -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 = {}
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user