Add observability stack with Grafana, Prometheus, Loki, and cAdvisor
- Introduced a new Grafana dashboard for monitoring Docker containers using cAdvisor. - Created provisioning files for Grafana dashboards and data sources. - Added Dockerfiles and configuration files for Loki and Prometheus. - Implemented a Docker Compose stack for the observability services. - Configured Traefik as a reverse proxy for the services with appropriate routing. - Added scripts for SSH tunneling to access the telemetry dashboard. - Included secrets management for Grafana admin credentials.
This commit is contained in:
3
observability/alloy/Dockerfile
Normal file
3
observability/alloy/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
||||
FROM grafana/alloy:latest
|
||||
|
||||
COPY config.alloy /etc/alloy/config.alloy
|
||||
29
observability/alloy/config.alloy
Normal file
29
observability/alloy/config.alloy
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
discovery.docker "containers" {
|
||||
host = "unix:///var/run/docker.sock"
|
||||
}
|
||||
|
||||
discovery.relabel "swarm" {
|
||||
targets = []
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_docker_container_name"]
|
||||
regex = "^/?(.*)$"
|
||||
target_label = "container_name"
|
||||
}
|
||||
}
|
||||
|
||||
loki.source.docker "docker" {
|
||||
host = "unix:///var/run/docker.sock"
|
||||
targets = discovery.docker.containers.targets
|
||||
relabel_rules = discovery.relabel.swarm.rules
|
||||
forward_to = [loki.write.default.receiver]
|
||||
|
||||
labels = { job = "docker" } // label stable pour requêter
|
||||
}
|
||||
|
||||
loki.write "default" {
|
||||
endpoint {
|
||||
url = "http://loki:3100/loki/api/v1/push"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user