mirror of
https://github.com/elAgala/server-initializer.git
synced 2026-02-14 05:06:18 +00:00
refactor: rethink monitoring structure | add Loki && Promtail | new Grafana conf
This commit is contained in:
@@ -1,20 +1,39 @@
|
||||
services:
|
||||
# PORT 9099
|
||||
# PORT 9090 (internal only)
|
||||
prometheus:
|
||||
image: prom/prometheus:v3.4.2
|
||||
container_name: prometheus
|
||||
restart: always
|
||||
volumes:
|
||||
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
||||
- prometheus_data:/prometheus
|
||||
networks:
|
||||
- monitoring_net
|
||||
- caddy_net
|
||||
# No ports exposed - access via Caddy only
|
||||
command:
|
||||
- '--config.file=/etc/prometheus/prometheus.yml'
|
||||
- '--storage.tsdb.path=/prometheus'
|
||||
- '--storage.tsdb.retention.time=30d'
|
||||
- '--web.console.libraries=/etc/prometheus/console_libraries'
|
||||
- '--web.console.templates=/etc/prometheus/consoles'
|
||||
- '--web.enable-lifecycle'
|
||||
|
||||
# PORT 9100
|
||||
node_exporter:
|
||||
image: prom/node-exporter:v1.9.1
|
||||
container_name: node-exporter
|
||||
restart: always
|
||||
pid: host
|
||||
volumes:
|
||||
- /proc:/host/proc:ro
|
||||
- /sys:/host/sys:ro
|
||||
- /:/rootfs:ro
|
||||
command:
|
||||
- '--path.procfs=/host/proc'
|
||||
- '--path.rootfs=/rootfs'
|
||||
- '--path.sysfs=/host/sys'
|
||||
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
|
||||
networks:
|
||||
- monitoring_net
|
||||
|
||||
@@ -31,10 +50,41 @@ services:
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- monitoring_net
|
||||
command:
|
||||
- '--housekeeping_interval=10s'
|
||||
- '--docker_only=true'
|
||||
|
||||
# PORT 3100
|
||||
loki:
|
||||
image: grafana/loki:3.4.0
|
||||
container_name: loki
|
||||
volumes:
|
||||
- ./loki/loki.yml:/etc/loki/local-config.yaml
|
||||
- loki_data:/loki
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- monitoring_net
|
||||
command: -config.file=/etc/loki/local-config.yaml
|
||||
|
||||
# PORT 9080
|
||||
promtail:
|
||||
image: grafana/promtail:3.4.0
|
||||
container_name: promtail
|
||||
volumes:
|
||||
- ./promtail/promtail.yml:/etc/promtail/config.yml
|
||||
- ../caddy/logs:/var/log/caddy:ro
|
||||
- /var/log:/var/log:ro
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- monitoring_net
|
||||
command: -config.file=/etc/promtail/config.yml
|
||||
|
||||
volumes:
|
||||
prometheus_data:
|
||||
loki_data:
|
||||
|
||||
networks:
|
||||
monitoring_net:
|
||||
external: true
|
||||
caddy_net:
|
||||
external: true
|
||||
|
||||
external: true
|
||||
Reference in New Issue
Block a user