forked from clementduveau/intro-to-mltp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
324 lines (308 loc) · 12.9 KB
/
docker-compose.yml
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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
version: "2.1"
volumes:
grafana:
postgres:
services:
# Grafana agent batches and processes traces sent to it, generating
# auto-logs from those traces.
agent:
image: grafana/agent:v0.39.1
ports:
- "12347:12345"
- "12348:12348"
- "6832:6832"
- "55679:55679"
volumes:
# To run using a Static configuration instead, uncomment out the following line.
#- "./agent/config.yaml:/etc/agent/agent.yaml"
# To run using a Static configuration instead, comment the following line.
- "./agent/config.river:/etc/agent/config.river"
# To run using a Static configuration instead, uncomment out the following block.
#command: [
# "-config.file=/etc/agent/agent.yaml",
# "-server.http.address=0.0.0.0:12345",
#]
# To run using a Static configuration instead, comment the following `environment` and
# `command` blocks.
environment:
- AGENT_MODE=flow
command: [
"run",
"--server.http.listen-addr=0.0.0.0:12345",
"/etc/agent/config.river",
]
# The Grafana dashboarding server.
grafana:
image: grafana/grafana:10.2.1
volumes:
- "./grafana/definitions:/var/lib/grafana/dashboards"
- "./grafana/provisioning:/etc/grafana/provisioning"
ports:
- "3000:3000"
environment:
# - GF_FEATURE_TOGGLES_ENABLE=flameGraph traceqlSearch traceQLStreaming correlations metricsSummary traceqlEditor
- GF_FEATURE_TOGGLES_ENABLE=flameGraph traceqlSearch traceQLStreaming correlations metricsSummary traceqlEditor traceToMetrics traceToProfiles tracesEmbeddedFlameGraph flameGraphItemCollapsing
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_DISABLE_LOGIN_FORM=true
# This creates a writeable Tempo data source and a couple of correlations.
# NOTE: This relies on the Tempo data source not existing at first start, should you delete
# the Tempo data source and re-run this service (via a `docker compose up`), extra
# copies of correlations will be generated!
grafana_api_data:
build: ./curl
depends_on:
- grafana
# A RabbitMQ queue used to send message between the requester and the server microservices.
mythical-queue:
image: rabbitmq:management
restart: on-failure
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: rabbitmq-diagnostics check_running
interval: 5s
timeout: 30s
retries: 10
# A postgres DB used to store data by the API server microservice.
mythical-database:
image: postgres:14.5
restart: on-failure
environment:
POSTGRES_PASSWORD: "mythical"
volumes:
- "postgres:/var/lib/postgresql/data"
ports:
- "5432:5432"
# A postgres DB used to store data by the API server microservice.
postgres-exporter:
image: quay.io/prometheuscommunity/postgres-exporter:v0.15.0
restart: on-failure
environment:
DATA_SOURCE_NAME: "postgresql://postgres:mythical@mythical-database:5432/postgres?sslmode=disable"
ports:
- "9187:9187"
depends_on:
mythical-database:
condition: service_started
# A microservice that makes requests to the API server microservice. Requests are also pushed onto the mythical-queue.
mythical-requester:
#build:
# context: ./source
# dockerfile: docker/Dockerfile
# args:
# SERVICE: mythical-beasts-requester
image: grafana/intro-to-mltp:mythical-beasts-requester-latest
depends_on:
mythical-queue:
condition: service_healthy
mythical-server:
condition: service_started
ports:
- "4001:4001"
environment:
- NAMESPACE=production
- LOGS_TARGET=http://loki:3100/loki/api/v1/push
- TRACING_COLLECTOR_HOST=agent
- TRACING_COLLECTOR_PORT=4317
- OTEL_EXPORTER_OTLP_TRACES_INSECURE=true
- OTEL_RESOURCE_ATTRIBUTES=ip=1.2.3.4
# The API server microservice.
# It writes logs directly to the Loki service, exposes metrics for the Prometheus
# service and sends traces to the Grafana Agent instance.
mythical-server:
#build:
# context: ./source
# dockerfile: docker/Dockerfile
# args:
# SERVICE: mythical-beasts-server
image: grafana/intro-to-mltp:mythical-beasts-server-latest
ports:
- "4000:4000"
- "80:80"
depends_on:
- mythical-database
environment:
- NAMESPACE=production
- LOGS_TARGET=http://loki:3100/loki/api/v1/push
- TRACING_COLLECTOR_HOST=agent
- TRACING_COLLECTOR_PORT=4317
- OTEL_EXPORTER_OTLP_TRACES_INSECURE=true
- OTEL_RESOURCE_ATTRIBUTES=ip=1.2.3.5
# A microservice that consumes requests from the mythical-queue
mythical-recorder:
#build:
# context: ./source
# dockerfile: docker/Dockerfile
# args:
# SERVICE: mythical-beasts-recorder
image: grafana/intro-to-mltp:mythical-beasts-recorder-latest
depends_on:
mythical-queue:
condition: service_healthy
ports:
- "4002:4002"
environment:
- NAMESPACE=production
- LOGS_TARGET=http://loki:3100/loki/api/v1/push
- TRACING_COLLECTOR_HOST=agent
- TRACING_COLLECTOR_PORT=4317
- OTEL_EXPORTER_OTLP_TRACES_INSECURE=true
- OTEL_RESOURCE_ATTRIBUTES=ip=1.2.3.5
# The Tempo service stores traces send to it by Grafana Agent, and takes
# queries from Grafana to visualise those traces.
tempo:
image: grafana/tempo:2.3.0
ports:
- "3200:3200"
- "4317:4317"
- "4318:4318"
- "9411:9411"
- "55680:55680"
- "55681:55681"
- "14250:14250"
command: [ "-config.file=/etc/tempo.yaml" ]
volumes:
- "./tempo/tempo.yaml:/etc/tempo.yaml"
# The Loki service stores logs sent to it, and takes queries from Grafana
# to visualise those logs.
loki:
# image: grafana/loki:2.9.2
image: grafana/loki:2.9.4
ports:
- "3100:3100"
mimir:
# image: grafana/mimir:2.10.4
image: grafana/mimir:2.11.0
command: ["-ingester.native-histograms-ingestion-enabled=true", "-config.file=/etc/mimir.yaml"]
ports:
- "9009:9009"
volumes:
- "./mimir/mimir.yaml:/etc/mimir.yaml"
k6:
image: grafana/k6
volumes:
- "./k6:/scripts"
environment:
- K6_PROMETHEUS_RW_SERVER_URL=http://mimir:9009/api/v1/push
# - K6_DURATION=3600s
- K6_DURATION=7200s
- K6_VUS=4
- K6_PROMETHEUS_RW_TREND_AS_NATIVE_HISTOGRAM=true
restart: on-failure
command: ["run", "-o", "experimental-prometheus-rw", "--tag", "testid=mythical-loadtest", "/scripts/mythical-loadtest.js"]
pyroscope:
# image: grafana/pyroscope:1.2.0
image: grafana/pyroscope:1.3.0
ports:
- "4040:4040"
command: ["server"]
beyla-requester:
image: grafana/beyla:latest
# Beyla requires to be run in the same process namespace as the process it's watching.
# In Docker, we can do this by joining the namespace for the watched process with the Beyla
# container watching it by using a specific `pid` label.
pid: "service:mythical-requester"
# Beyla requires the SYS_ADMIN capability to run, to add hooks to the underlying kernel.
# Note that you should *always* be aware of the security implications of adding capabilities
# before you do so.
cap_add:
- SYS_ADMIN
# If using the above capability fails to instrument your service, remove it and uncomment the
# line below. Beware that this will allow Beyla to run with full privileges, which may be
# undesirable.
#privileged: true
command:
- /beyla
- --config=/configs/config.yaml
volumes:
- ./beyla/:/configs
# See the full list of configuration options at
# https://grafana.com/docs/grafana-cloud/monitor-applications/beyla/configure/options/ for more details on the
# options set below.
environment:
BEYLA_OPEN_PORT: "4001" # Instrument any service listening on port 4001.
BEYLA_SERVICE_NAMESPACE: "mythical" # The namespace for the service.
BEYLA_PROMETHEUS_PORT: "9090" # The port to expose Prometheus metrics on.
#BEYLA_BPF_TRACK_REQUEST_HEADERS: "true"
OTEL_SERVICE_NAME: "beyla-mythical-requester" # The service name to use for OpenTelemetry traces.
OTEL_EXPORTER_OTLP_TRACES_INSECURE: true # Whether to use an insecure connection to Grafana Agent.
OTEL_EXPORTER_OTLP_PROTOCOL: "grpc" # The protocol to use to send traces to Grafana Agent.
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "http://agent:4317/" # The endpoint to send traces to.
# The `depends_on` block below ensures that the mythical-requester service is started before Beyla.
depends_on:
mythical-requester:
condition: service_started
beyla-server:
image: grafana/beyla:latest
# Beyla requires to be run in the same process namespace as the process it's watching.
# In Docker, we can do this by joining the namespace for the watched process with the Beyla
# container watching it by using a specific `pid` label.
pid: "service:mythical-server"
# Beyla requires the SYS_ADMIN capability to run, to add hooks to the underlying kernel.
# Note that you should *always* be aware of the security implications of adding capabilities
# before you do so.
cap_add:
- SYS_ADMIN
# If using the above capability fails to instrument your service, remove it and uncomment the
# line below. Beware that this will allow Beyla to run with full privileges, which may be
# undesirable.
#privileged: true
command:
- /beyla
- --config=/configs/config.yaml
volumes:
- ./beyla/:/configs
# See the full list of configuration options at
# https://grafana.com/docs/grafana-cloud/monitor-applications/beyla/configure/options/ for more details on the
# options set below.
environment:
BEYLA_OPEN_PORT: "4000" # Instrument any service listening on port 4001.
BEYLA_SERVICE_NAMESPACE: "mythical" # The namespace for the service.
BEYLA_PROMETHEUS_PORT: "9090" # The port to expose Prometheus metrics on.
#BEYLA_BPF_TRACK_REQUEST_HEADERS: "true"
OTEL_SERVICE_NAME: "beyla-mythical-server" # The service name to use for OpenTelemetry traces.
OTEL_EXPORTER_OTLP_TRACES_INSECURE: true # Whether to use an insecure connection to Grafana Agent.
OTEL_EXPORTER_OTLP_PROTOCOL: "grpc" # The protocol to use to send traces to Grafana Agent.
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "http://agent:4317/" # The endpoint to send traces to.
# The `depends_on` block below ensures that the mythical-server service is started before Beyla.
depends_on:
mythical-server:
condition: service_started
beyla-recorder:
image: grafana/beyla:latest
# Beyla requires to be run in the same process namespace as the process it's watching.
# In Docker, we can do this by joining the namespace for the watched process with the Beyla
# container watching it by using a specific `pid` label.
pid: "service:mythical-recorder"
# Beyla requires the SYS_ADMIN capability to run, to add hooks to the underlying kernel.
# Note that you should *always* be aware of the security implications of adding capabilities
# before you do so.
cap_add:
- SYS_ADMIN
# If using the above capability fails to instrument your service, remove it and uncomment the
# line below. Beware that this will allow Beyla to run with full privileges, which may be
# undesirable.
#privileged: true
command:
- /beyla
- --config=/configs/config.yaml
volumes:
- ./beyla/:/configs
# See the full list of configuration options at
# https://grafana.com/docs/grafana-cloud/monitor-applications/beyla/configure/options/ for more details on the
# options set below.
environment:
BEYLA_OPEN_PORT: "4002" # Instrument any service listening on port 4001.
BEYLA_SERVICE_NAMESPACE: "mythical" # The namespace for the service.
BEYLA_PROMETHEUS_PORT: "9090" # The port to expose Prometheus metrics on.
#BEYLA_BPF_TRACK_REQUEST_HEADERS: "true"
OTEL_SERVICE_NAME: "beyla-mythical-recorder" # The service name to use for OpenTelemetry traces.
OTEL_EXPORTER_OTLP_TRACES_INSECURE: true # Whether to use an insecure connection to Grafana Agent.
OTEL_EXPORTER_OTLP_PROTOCOL: "grpc" # The protocol to use to send traces to Grafana Agent.
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "http://agent:4317/" # The endpoint to send traces to.
# The `depends_on` block below ensures that the mythical-recorder service is started before Beyla.
depends_on:
mythical-recorder:
condition: service_started