Repository navigation
Expand file tree
/
Copy pathdocker-compose.observability.yml
More file actions
221 lines (208 loc) · 6.66 KB
/
Copy pathdocker-compose.observability.yml
File metadata and controls
221 lines (208 loc) · 6.66 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
name: popchoice-observability
services:
observability-tempo:
build:
context: .
dockerfile: observability/images/tempo/Dockerfile
image: popchoice-observability-tempo:${OBSERVABILITY_IMAGE_TAG:-local}
container_name: popchoice-observability-tempo
restart: unless-stopped
command: ['-config.file=/etc/tempo/tempo.yaml']
ports:
- '127.0.0.1:3200:3200'
volumes:
- tempodata:/var/tempo
healthcheck:
test: ['CMD', '/busybox/wget', '-q', '--spider', '-T', '5', 'http://127.0.0.1:3200/ready']
interval: 30s
timeout: 10s
retries: 5
observability-otel-collector:
build:
context: .
dockerfile: observability/images/otel-collector/Dockerfile
image: popchoice-observability-otel-collector:${OBSERVABILITY_IMAGE_TAG:-local}
container_name: popchoice-observability-otel-collector
restart: unless-stopped
command: ['--config=/etc/otelcol/config.yaml']
ports:
- '127.0.0.1:4317:4317'
- '127.0.0.1:4318:4318'
depends_on:
observability-tempo:
condition: service_healthy
networks:
- default
- popchoice-app
observability-prometheus:
build:
context: .
dockerfile: observability/images/prometheus/Dockerfile
image: popchoice-observability-prometheus:${OBSERVABILITY_IMAGE_TAG:-local}
container_name: popchoice-observability-prometheus
restart: unless-stopped
command:
[
'--config.file=/tmp/prometheus.yml',
'--storage.tsdb.path=/prometheus',
'--storage.tsdb.retention.time=15d',
'--web.enable-lifecycle',
]
environment:
METRICS_BEARER_TOKEN: ${METRICS_BEARER_TOKEN:-}
POPCHOICE_WEB_METRICS_TARGET: ${POPCHOICE_WEB_METRICS_TARGET:-web:3000}
POPCHOICE_WORKERS_METRICS_TARGET: ${POPCHOICE_WORKERS_METRICS_TARGET:-workers:9464}
ports:
- '127.0.0.1:9090:9090'
volumes:
- prometheusdata:/prometheus
extra_hosts:
- 'host.docker.internal:host-gateway'
networks:
- default
- popchoice-app
healthcheck:
test: ['CMD', '/bin/wget', '-q', '--spider', '-T', '5', 'http://127.0.0.1:9090/-/ready']
interval: 30s
timeout: 10s
retries: 5
observability-cadvisor:
image: gcr.io/cadvisor/cadvisor:v0.52.1
container_name: popchoice-observability-cadvisor
restart: unless-stopped
command: ['--docker_only=true', '--housekeeping_interval=30s']
privileged: true
devices:
- /dev/kmsg:/dev/kmsg
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
observability-node-exporter:
image: prom/node-exporter:v1.9.1
container_name: popchoice-observability-node-exporter
restart: unless-stopped
command:
[
'--path.rootfs=/host',
'--collector.filesystem.mount-points-exclude=^/(dev|proc|sys|var/lib/docker/.+|var/lib/kubelet/.+)($$|/)',
]
pid: host
volumes:
- /:/host:ro,rslave
- /run/udev:/run/udev:ro
observability-postgres-exporter:
image: prometheuscommunity/postgres-exporter:v0.18.1
container_name: popchoice-observability-postgres-exporter
restart: unless-stopped
environment:
DATA_SOURCE_URI: ${POSTGRES_EXPORTER_DATA_SOURCE_URI:-db:5432/popchoice?sslmode=disable}
DATA_SOURCE_USER: ${POSTGRES_EXPORTER_DATA_SOURCE_USER:-popchoice}
DATA_SOURCE_PASS: ${POSTGRES_EXPORTER_DATA_SOURCE_PASS:-}
networks:
- default
- popchoice-app
observability-redis-exporter:
image: oliver006/redis_exporter:v1.80.1
container_name: popchoice-observability-redis-exporter
restart: unless-stopped
environment:
REDIS_ADDR: ${REDIS_EXPORTER_REDIS_ADDR:-redis://redis:6379}
networks:
- default
- popchoice-app
observability-uptime-kuma:
image: louislam/uptime-kuma:1.23.16
container_name: popchoice-observability-uptime-kuma
restart: unless-stopped
ports:
- '127.0.0.1:3002:3001'
volumes:
- uptime-kuma-data:/app/data
healthcheck:
test:
[
'CMD-SHELL',
'node -e "fetch(''http://127.0.0.1:3001'').then(r=>process.exit(r.status<500?0:1)).catch(()=>process.exit(1))"',
]
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
observability-loki:
build:
context: .
dockerfile: observability/images/loki/Dockerfile
image: popchoice-observability-loki:${OBSERVABILITY_IMAGE_TAG:-local}
container_name: popchoice-observability-loki
restart: unless-stopped
command: ['-config.file=/etc/loki/loki.yaml']
ports:
- '127.0.0.1:3100:3100'
volumes:
- lokidata:/loki
healthcheck:
test: ['CMD', '/busybox/wget', '-q', '--spider', '-T', '5', 'http://127.0.0.1:3100/ready']
interval: 30s
timeout: 10s
retries: 5
observability-alloy:
build:
context: .
dockerfile: observability/images/alloy/Dockerfile
image: popchoice-observability-alloy:${OBSERVABILITY_IMAGE_TAG:-local}
container_name: popchoice-observability-alloy
restart: unless-stopped
command:
[
'run',
'--server.http.listen-addr=0.0.0.0:12345',
'--storage.path=/var/lib/alloy/data',
'/etc/alloy/config.alloy',
]
ports:
- '127.0.0.1:12345:12345'
volumes:
- alloydata:/var/lib/alloy/data
- /var/run/docker.sock:/var/run/docker.sock:ro
depends_on:
observability-loki:
condition: service_healthy
observability-grafana:
build:
context: .
dockerfile: observability/images/grafana/Dockerfile
image: popchoice-observability-grafana:${OBSERVABILITY_IMAGE_TAG:-local}
container_name: popchoice-observability-grafana
restart: unless-stopped
environment:
GF_SECURITY_ADMIN_USER: ${GRAFANA_ADMIN_USER:-admin}
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:?Set GRAFANA_ADMIN_PASSWORD before starting observability}
GF_USERS_ALLOW_SIGN_UP: 'false'
GF_AUTH_ANONYMOUS_ENABLED: 'false'
GF_SERVER_ROOT_URL: ${GF_SERVER_ROOT_URL:-http://localhost:3000}
GRAFANA_TELEGRAM_BOT_TOKEN: ${GRAFANA_TELEGRAM_BOT_TOKEN:-}
GRAFANA_TELEGRAM_CHAT_ID: ${GRAFANA_TELEGRAM_CHAT_ID:-}
ports:
- '127.0.0.1:3001:3000'
volumes:
- grafanadata:/var/lib/grafana
depends_on:
observability-loki:
condition: service_healthy
observability-prometheus:
condition: service_healthy
observability-tempo:
condition: service_healthy
volumes:
alloydata:
grafanadata:
lokidata:
prometheusdata:
tempodata:
uptime-kuma-data:
networks:
popchoice-app:
name: ${POPCHOICE_APP_NETWORK:-popchoice_default}
external: true