Add observability platform Ansible project
Deploys the Grafana stack (Prometheus/Alertmanager/Loki/Tempo/Grafana with Alloy as collector) and the ELK stack (Filebeat/Logstash/Elasticsearch/ Kibana) via Docker Compose on a target host. External to the application repo, pre-built by the mentor.
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
services:
|
||||
prometheus:
|
||||
image: prom/prometheus:{{ prometheus_version }}
|
||||
restart: unless-stopped
|
||||
command:
|
||||
- --config.file=/etc/prometheus/prometheus.yml
|
||||
- --storage.tsdb.path=/prometheus
|
||||
- --storage.tsdb.retention.time=15d
|
||||
- --web.enable-lifecycle
|
||||
- --web.enable-remote-write-receiver
|
||||
volumes:
|
||||
- ./config/prometheus:/etc/prometheus:ro
|
||||
- prometheus-data:/prometheus
|
||||
ports:
|
||||
- "9090:9090"
|
||||
networks: [observability]
|
||||
|
||||
alertmanager:
|
||||
image: prom/alertmanager:{{ alertmanager_version }}
|
||||
restart: unless-stopped
|
||||
command:
|
||||
- --config.file=/etc/alertmanager/alertmanager.yml
|
||||
- --storage.path=/alertmanager
|
||||
volumes:
|
||||
- ./config/alertmanager:/etc/alertmanager:ro
|
||||
- alertmanager-data:/alertmanager
|
||||
ports:
|
||||
- "9093:9093"
|
||||
networks: [observability]
|
||||
|
||||
loki:
|
||||
image: grafana/loki:{{ loki_version }}
|
||||
restart: unless-stopped
|
||||
command: ["-config.file=/etc/loki/loki.yml"]
|
||||
volumes:
|
||||
- ./config/loki/loki.yml:/etc/loki/loki.yml:ro
|
||||
- loki-data:/var/loki
|
||||
ports:
|
||||
- "3100:3100"
|
||||
networks: [observability]
|
||||
|
||||
tempo:
|
||||
image: grafana/tempo:{{ tempo_version }}
|
||||
restart: unless-stopped
|
||||
command: ["-config.file=/etc/tempo/tempo.yml"]
|
||||
volumes:
|
||||
- ./config/tempo/tempo.yml:/etc/tempo/tempo.yml:ro
|
||||
- tempo-data:/var/tempo
|
||||
ports:
|
||||
- "3200:3200"
|
||||
networks: [observability]
|
||||
|
||||
node-exporter:
|
||||
image: prom/node-exporter:{{ node_exporter_version }}
|
||||
restart: unless-stopped
|
||||
command:
|
||||
- --path.rootfs=/host
|
||||
pid: host
|
||||
volumes:
|
||||
- /:/host:ro,rslave
|
||||
ports:
|
||||
- "9100:9100"
|
||||
networks: [observability]
|
||||
|
||||
alloy:
|
||||
image: grafana/alloy:{{ alloy_version }}
|
||||
restart: unless-stopped
|
||||
command:
|
||||
- run
|
||||
- --server.http.listen-addr=0.0.0.0:12345
|
||||
- --storage.path=/var/lib/alloy/data
|
||||
- /etc/alloy/config.alloy
|
||||
volumes:
|
||||
- ./config/alloy/config.alloy:/etc/alloy/config.alloy:ro
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- alloy-data:/var/lib/alloy/data
|
||||
ports:
|
||||
- "12345:12345"
|
||||
- "4317:4317"
|
||||
- "4318:4318"
|
||||
networks: [observability]
|
||||
|
||||
grafana:
|
||||
image: grafana/grafana:{{ grafana_version }}
|
||||
restart: unless-stopped
|
||||
depends_on: [prometheus, loki, tempo]
|
||||
environment:
|
||||
GF_SECURITY_ADMIN_USER: "{{ grafana_admin_user }}"
|
||||
GF_SECURITY_ADMIN_PASSWORD: "{{ grafana_admin_password }}"
|
||||
GF_USERS_ALLOW_SIGN_UP: "false"
|
||||
GF_FEATURE_TOGGLES_ENABLE: traceqlEditor
|
||||
volumes:
|
||||
- grafana-data:/var/lib/grafana
|
||||
- ./config/grafana/provisioning:/etc/grafana/provisioning:ro
|
||||
ports:
|
||||
- "3000:3000"
|
||||
networks: [observability]
|
||||
|
||||
volumes:
|
||||
prometheus-data:
|
||||
alertmanager-data:
|
||||
loki-data:
|
||||
tempo-data:
|
||||
alloy-data:
|
||||
grafana-data:
|
||||
|
||||
networks:
|
||||
observability:
|
||||
driver: bridge
|
||||
|
||||
Reference in New Issue
Block a user