-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.monitoring.yml
More file actions
144 lines (133 loc) · 3.78 KB
/
docker-compose.monitoring.yml
File metadata and controls
144 lines (133 loc) · 3.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
version: '3.8'
services:
# Prometheus - Metrics collection
prometheus:
image: prom/prometheus:v2.47.0
container_name: prometheus
ports:
- "9090:9090"
volumes:
- ../infrastructure/monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
- ../infrastructure/monitoring/alert_rules.yml:/etc/prometheus/alert_rules.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--storage.tsdb.retention.time=200h'
- '--web.enable-lifecycle'
- '--web.enable-admin-api'
networks:
- monitoring
# AlertManager - Alert handling
alertmanager:
image: prom/alertmanager:v0.26.0
container_name: alertmanager
ports:
- "9093:9093"
volumes:
- ../infrastructure/monitoring/alertmanager.yml:/etc/alertmanager/alertmanager.yml
- alertmanager_data:/alertmanager
command:
- '--config.file=/etc/alertmanager/alertmanager.yml'
- '--storage.path=/alertmanager'
- '--web.external-url=http://localhost:9093'
networks:
- monitoring
# Grafana - Visualization
grafana:
image: grafana/grafana:10.1.0
container_name: grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin123
- GF_USERS_ALLOW_SIGN_UP=false
- GF_SECURITY_ALLOW_EMBEDDING=true
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer
volumes:
- grafana_data:/var/lib/grafana
- ../infrastructure/grafana/provisioning:/etc/grafana/provisioning
- ../infrastructure/grafana/dashboards:/etc/grafana/provisioning/dashboards
networks:
- monitoring
# Jaeger - Distributed tracing
jaeger:
image: jaegertracing/all-in-one:1.49
container_name: jaeger
ports:
- "16686:16686"
- "14268:14268"
- "14250:14250"
environment:
- COLLECTOR_OTLP_ENABLED=true
networks:
- monitoring
# Loki - Log aggregation
loki:
image: grafana/loki:2.9.0
container_name: loki
ports:
- "3100:3100"
volumes:
- loki_data:/loki
command: -config.file=/etc/loki/local-config.yaml
networks:
- monitoring
# Promtail - Log collection
promtail:
image: grafana/promtail:2.9.0
container_name: promtail
volumes:
- /var/log:/var/log:ro
- ../infrastructure/monitoring/promtail.yml:/etc/promtail/config.yml
command: -config.file=/etc/promtail/config.yml
networks:
- monitoring
# Node Exporter - System metrics
node-exporter:
image: prom/node-exporter:v1.6.1
container_name: node-exporter
ports:
- "9100:9100"
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
# Redis Exporter - Redis metrics
redis-exporter:
image: oliver006/redis_exporter:v1.53.0
container_name: redis-exporter
ports:
- "9121:9121"
environment:
- REDIS_ADDR=redis://redis:6379
networks:
- monitoring
# Postgres Exporter - PostgreSQL metrics
postgres-exporter:
image: prometheuscommunity/postgres-exporter:v0.13.2
container_name: postgres-exporter
ports:
- "9187:9187"
environment:
- DATA_SOURCE_NAME=postgresql://postgres:password@postgres:5432/energy_tracking?sslmode=disable
networks:
- monitoring
volumes:
prometheus_data:
grafana_data:
alertmanager_data:
loki_data:
networks:
monitoring:
external: true