-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
266 lines (241 loc) · 7.47 KB
/
docker-compose.yaml
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
services:
# Tempo runs as user 10001, and docker compose creates the volume as root.
# As such, we need to chown the volume in order for Tempo to start correctly.
# init:
# image: grafana/tempo:latest
# user: root
# entrypoint:
# - "chown"
# - "10001:10001"
# - "/var/tempo"
# volumes:
# - ./data/tempo:/var/tempo
# Database to store traces by Grafana Labs
tempo:
image: grafana/tempo:2.6.1 # tested on 2.6.1
command: [ "-config.file=/etc/tempo.yaml" ]
volumes:
- ./etc/tempo/tempo.yaml:/etc/tempo.yaml
# - ./data/tempo:/var/tempo
# ports:
# - "3200:3200" # tempo
# - "9095:9095" # tempo grpc
# - "4317:4317" # otlp grpc
# - "4318:4318" # otlp http
# depends_on:
# - init
# Jaeger
jaeger:
image: jaegertracing/all-in-one:1.59.0
volumes:
- ./etc/jaeger/jaeger-ui.json:/etc/jaeger/jaeger-ui.json
command:
- --query.ui-config=/etc/jaeger/jaeger-ui.json
environment:
- COLLECTOR_OTLP_ENABLED=true
- COLLECTOR_OTLP_GRPC_HOST_PORT=:4317
- COLLECTOR_OTLP_HTTP_HOST_PORT=:4318
- METRICS_STORAGE_TYPE=prometheus
- PROMETHEUS_SERVER_URL=http://prometheus:9090
- LOG_LEVEL=debug
ports:
- "16686:16686" # Jaeger UI accessed by http://localhost:16686
# - "14269:14269" # health check at / and metrics at /metrics
# - "4317:4317" # OTLP gRPC receiver
# And put them in an OTEL collector pipeline...
otel-collector:
# image: otel/opentelemetry-collector-contrib:latest
image: otel/opentelemetry-collector:0.112.0
command: [ "--config=/etc/otel-collector.yaml" ]
volumes:
- ./etc/otel-collector/config.yaml:/etc/otel-collector.yaml
ports:
# - "1888:1888" # pprof extension
# - "8888:8888" # Prometheus metrics exposed by the collector
# - "8889:8889" # Prometheus exporter metrics
# - "13133:13133" # health_check extension
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
# - "55679:55679" # zpages extension
depends_on:
- tempo
- jaeger
loki:
image: grafana/loki:3.1.0 # tested on 3.1.0
command: ["--pattern-ingester.enabled=true", "--config.file=/etc/loki/loki.yaml"]
ports:
- "3100:3100"
volumes:
- "./etc/loki/loki.yaml:/etc/loki/loki.yaml"
# As such, we need to chown the volume in order for Tempo to start correctly.
pyrra-init:
image: ghcr.io/pyrra-dev/pyrra:v0.7.7
user: root
entrypoint:
- "chown"
- "65533:65533"
- "/etc/prometheus/pyrra"
volumes:
- prometheus_pyrra:/etc/prometheus/pyrra
pyrra-sleep:
image: ghcr.io/pyrra-dev/pyrra:v0.7.7
entrypoint:
- "sleep"
- "5"
prometheus:
image: prom/prometheus:v2.55.0
hostname: localhost
command:
- --config.file=/etc/prometheus.yaml
- --web.enable-remote-write-receiver
- --web.enable-lifecycle
- --enable-feature=exemplar-storage
- --enable-feature=native-histograms
volumes:
- ./etc/prometheus/prometheus.yaml:/etc/prometheus.yaml
- prometheus_pyrra:/etc/prometheus/pyrra
ports:
- "9090:9090"
alertmanager:
image: prom/alertmanager:v0.27.0
hostname: localhost
ports:
- "9093:9093"
volumes:
- ./etc/alertmanager/:/etc/alertmanager/
- alertmanager:/data
command:
- '--config.file=/etc/alertmanager/config.yml'
- '--log.level=debug'
webhook-tester:
image: tarampampam/webhook-tester:1.1.0
command: serve --port 8080
ports:
- '8080:8080'
environment:
- CREATE_SESSION=00000000-0000-0000-0000-000000000000
karma:
image: ghcr.io/prymitive/karma:v0.120
ports:
- '8081:8081'
environment:
- ALERTMANAGER_URI=http://alertmanager:9093
- ALERTMANAGER_INTERVAL=10s
- PORT=8081
depends_on:
- alertmanager
pyrra-api:
image: ghcr.io/pyrra-dev/pyrra:v0.7.7
command:
- api
- --prometheus-url=http://prometheus:9090
- --prometheus-external-url=http://localhost:9090
- --api-url=http://pyrra-filesystem:9444
ports:
- "9099:9099"
depends_on:
- prometheus
pyrra-filesystem:
image: ghcr.io/pyrra-dev/pyrra:v0.7.7
command:
- filesystem
- --log-level=debug
- --prometheus-url=http://prometheus:9090
- --generic-rules
volumes:
- ./etc/pyrra:/etc/pyrra
- prometheus_pyrra:/etc/prometheus/pyrra
depends_on:
- prometheus
- pyrra-api
- pyrra-init
grafana:
image: grafana/grafana:11.3.0 # tested on 11.1.0
volumes:
- ./etc/grafana/datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
- ./etc/grafana/dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml
- ./etc/grafana/plugins.yaml:/etc/grafana/provisioning/plugins/plugins.yaml
- ./etc/dashboards:/etc/grafana/dashboards
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_DISABLE_LOGIN_FORM=true
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor traceQLStreaming metricsSummary traceToMetrics traceqlSearch
# - GF_INSTALL_PLUGINS=grafana-lokiexplore-app
- GF_INSTALL_PLUGINS=grafana-lokiexplore-app, grafana-pyroscope-app
# - GF_INSTALL_PLUGINS=https://storage.googleapis.com/integration-artifacts/grafana-lokiexplore-app/grafana-lokiexplore-app-latest.zip;grafana-lokiexplore-app
ports:
- "3000:3000"
depends_on:
- tempo
- loki
- pyroscope
fastapi-app:
image: fastapi_app
build:
context: ./fastapi_app
environment:
- OTLP_GRPC_ENDPOINT=http://otel-collector:4317
- DATABASE_URL=postgresql://user:password@postgres-db:5432/db
- PYROSCOPE_ENDPOINT=http://pyroscope:4040
command:
- 'python3'
# - 'app_with__traces.py'
# - 'app_with__traces_logs_metrics_db.py'
- 'app_with__traces_logs_metrics_profiles_db.py'
- "8000:8000"
ports:
- "8000:8000"
depends_on:
- otel-collector
- postgres-db
flask-app:
image: flask_app
build:
context: ./flask_app
environment:
- FASTAPI_URL=http://fastapi-app:8000
- OTEL_SERVICE_NAME=flask-app
- OTEL_EXPORTER_OTLP_PROTOCOL=grpc
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
- OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true
- OTEL_PYTHON_LOG_CORRELATION=true
- OTEL_EXPORTER_PROMETHEUS_HOST=0.0.0.0
- OTEL_EXPORTER_PROMETHEUS_PORT=9464
- OTEL_TRACES_EXPORTER=otlp
- OTEL_METRICS_EXPORTER=otlp,prometheus
- OTEL_LOGS_EXPORTER=otlp
# - OTEL_TRACES_EXPORTER=console
# - OTEL_METRICS_EXPORTER=none
# - OTEL_LOGS_EXPORTER=none
command:
- 'opentelemetry-instrument'
- 'python3'
# - 'app.py'
- 'app_client.py'
ports:
- "8001:8001"
- "9464:9464"
depends_on:
- otel-collector
postgres-db:
image: postgres:16-alpine
volumes:
# - ./data/postgres/:/var/lib/postgresql/data/
- ./etc/postgres/:/docker-entrypoint-initdb.d/
environment:
- POSTGRES_USER=user
- POSTGRES_PASSWORD=password
- POSTGRES_DB=db
ports:
- "5432:5432"
pyroscope:
image: grafana/pyroscope:1.9.1
command: [ "-config.file=/etc/pyroscope.yml" ]
ports:
- "4040:4040"
volumes:
- ./etc/pyroscope/pyroscope.yml:/etc/pyroscope.yml
volumes:
prometheus_pyrra: {}
alertmanager: {}