-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathdocker-compose.monitoring.yml
More file actions
159 lines (150 loc) · 4.8 KB
/
Copy pathdocker-compose.monitoring.yml
File metadata and controls
159 lines (150 loc) · 4.8 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# Breeze RMM - Optional Monitoring Stack
# Usage: docker compose -f docker-compose.yml -f docker-compose.monitoring.yml up -d
#
# Includes: Prometheus, Grafana, Alertmanager, Loki, Promtail, and DB exporters.
# Requires the base docker-compose.yml to be running.
services:
prometheus:
image: prom/prometheus:v2.52.0
container_name: breeze-prometheus
restart: unless-stopped
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=15d'
- '--web.enable-lifecycle'
ports:
- '127.0.0.1:${PROMETHEUS_PORT:-9090}:9090'
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./monitoring/rules:/etc/prometheus/rules:ro
- prometheus_data:/prometheus
secrets:
- metrics_scrape_token
depends_on:
api:
condition: service_healthy
healthcheck:
test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:9090/-/healthy']
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks:
- breeze
grafana:
image: grafana/grafana:10.4.5
container_name: breeze-grafana
restart: unless-stopped
environment:
GF_SECURITY_ADMIN_USER: ${GRAFANA_ADMIN_USER:-admin}
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:?Set GRAFANA_ADMIN_PASSWORD in .env}
GF_USERS_ALLOW_SIGN_UP: 'false'
GF_SERVER_ROOT_URL: ${GRAFANA_ROOT_URL:-http://localhost:3000}
GF_INSTALL_PLUGINS: redis-datasource
ports:
- '127.0.0.1:${GRAFANA_PORT:-3000}:3000'
volumes:
- ./monitoring/grafana/datasources.yml:/etc/grafana/provisioning/datasources/datasources.yml:ro
- ./monitoring/grafana/dashboards.yml:/etc/grafana/provisioning/dashboards/dashboards.yml:ro
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards/breeze:ro
- grafana_data:/var/lib/grafana
depends_on:
prometheus:
condition: service_healthy
healthcheck:
test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:3000/api/health']
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
networks:
- breeze
alertmanager:
image: prom/alertmanager:v0.27.0
container_name: breeze-alertmanager
restart: unless-stopped
command:
- '--config.file=/etc/alertmanager/alertmanager.yml'
- '--storage.path=/alertmanager'
ports:
- '127.0.0.1:${ALERTMANAGER_PORT:-9093}:9093'
volumes:
- ./monitoring/alertmanager.yml:/etc/alertmanager/alertmanager.yml:ro
- alertmanager_data:/alertmanager
healthcheck:
test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:9093/-/healthy']
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks:
- breeze
loki:
image: grafana/loki:2.9.8
container_name: breeze-loki
restart: unless-stopped
command: -config.file=/etc/loki/config.yml
ports:
- '127.0.0.1:${LOKI_PORT:-3100}:3100'
volumes:
- ./monitoring/loki-config.yml:/etc/loki/config.yml:ro
- loki_data:/loki
healthcheck:
test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:3100/ready']
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks:
- breeze
promtail:
image: grafana/promtail:2.9.8
container_name: breeze-promtail
restart: unless-stopped
command: -config.file=/etc/promtail/config.yml
volumes:
- ./monitoring/promtail.yml:/etc/promtail/config.yml:ro
- /var/lib/docker/containers:/var/lib/docker/containers:ro
- promtail_positions:/var/lib/promtail
depends_on:
loki:
condition: service_healthy
networks:
- breeze
redis-exporter:
image: oliver006/redis_exporter:v1.61.0
container_name: breeze-redis-exporter
restart: unless-stopped
command: >
sh -ec 'export REDIS_PASSWORD="$$(cat /run/secrets/redis_password)";
exec /redis_exporter'
environment:
REDIS_ADDR: redis://redis:6379
secrets:
- redis_password
depends_on:
redis:
condition: service_healthy
networks:
- breeze
postgres-exporter:
image: prometheuscommunity/postgres-exporter:v0.15.0
container_name: breeze-postgres-exporter
restart: unless-stopped
environment:
DATA_SOURCE_NAME: postgresql://${POSTGRES_USER:-breeze}:${POSTGRES_PASSWORD:?POSTGRES_PASSWORD required}@postgres:5432/${POSTGRES_DB:-breeze}?sslmode=disable
depends_on:
postgres:
condition: service_healthy
networks:
- breeze
volumes:
prometheus_data:
grafana_data:
alertmanager_data:
loki_data:
promtail_positions:
secrets:
metrics_scrape_token:
environment: METRICS_SCRAPE_TOKEN