-
Notifications
You must be signed in to change notification settings - Fork 142
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
217 lines (205 loc) · 6.69 KB
/
docker-compose.yml
File metadata and controls
217 lines (205 loc) · 6.69 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
name: grafana-intro-to-mltp
volumes:
grafana:
postgres:
services:
# Grafana Alloy batches and processes traces sent to it, generating
# auto-logs from those traces.
# Includes Metrics, Logs, Traces and Profiles.
alloy:
image: grafana/alloy:v1.12.1
ports:
- "12350:12350"
- "12347:12345"
- "12348:12348"
- "6832:6832"
- "55679:55679"
- "4317:4317"
- "4318:4318"
volumes:
- "./alloy/config.alloy:/etc/alloy/config.alloy"
- "./alloy/endpoints.json:/etc/alloy/endpoints.json"
command: [
"run",
"--server.http.listen-addr=0.0.0.0:12345",
"--stability.level=public-preview",
"/etc/alloy/config.alloy",
]
# The Grafana dashboarding server.
grafana:
image: grafana/grafana:12.3.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 traceToMetrics traceToProfiles datatrails
- GF_INSTALL_PLUGINS=grafana-lokiexplore-app,grafana-exploretraces-app,grafana-pyroscope-app
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_DISABLE_LOGIN_FORM=true
# A RabbitMQ queue used to send message between the requester and the server microservices.
mythical-queue:
image: rabbitmq:management
restart: always
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: always
environment:
POSTGRES_PASSWORD: "mythical"
volumes:
- "postgres:/var/lib/postgresql/data"
ports:
- "5432:5432"
# 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
restart: always
depends_on:
mythical-queue:
condition: service_healthy
mythical-server:
condition: service_started
ports:
- "4001:4001"
environment:
- NAMESPACE=production
- LOGS_TARGET=http://alloy:3100/loki/api/v1/push
- TRACING_COLLECTOR_HOST=alloy
- TRACING_COLLECTOR_PORT=4317
- PROFILE_COLLECTOR_HOST=alloy
- PROFILE_COLLECTOR_PORT=4040
- OTEL_EXPORTER_OTLP_TRACES_INSECURE=true
- OTEL_RESOURCE_ATTRIBUTES=ip=1.2.3.4
# Uncomment this line to enable timeshift example in the mythical-requester service, which will use timestamps
# in the log lines themselves to rewrite the default timestamp to the time specified in the logline.
#- TIMESHIFT=true
# The API server microservice.
# It writes logs directly to the Loki service, exposes metrics for the Prometheus
# service and sends traces to the Grafana Alloy instance.
mythical-server:
#build:
# context: ./source
# dockerfile: docker/Dockerfile
# args:
# SERVICE: mythical-beasts-server
image: grafana/intro-to-mltp:mythical-beasts-server-latest
restart: always
ports:
- "4000:4000"
- "80:80"
depends_on:
- mythical-database
environment:
- NAMESPACE=production
- LOGS_TARGET=http://alloy:3100/loki/api/v1/push
- TRACING_COLLECTOR_HOST=alloy
- TRACING_COLLECTOR_PORT=4317
- PROFILE_COLLECTOR_HOST=alloy
- PROFILE_COLLECTOR_PORT=4040
- OTEL_EXPORTER_OTLP_TRACES_INSECURE=true
- OTEL_RESOURCE_ATTRIBUTES=ip=1.2.3.5
# Faro configuration for the frontend, sends to the local Alloy instance.
# You can change this to send to Grafana Cloud, but see the `docker-compose-cloud.yml` compose file instead
# to send all data to Grafana Cloud.
- FARO_ENDPOINT=http://localhost:12350/collect
- USE_GRAFANA_CLOUD=false
# 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
restart: always
depends_on:
mythical-queue:
condition: service_healthy
ports:
- "4002:4002"
environment:
- NAMESPACE=production
- LOGS_TARGET=http://alloy:3100/loki/api/v1/push
- TRACING_COLLECTOR_HOST=alloy
- TRACING_COLLECTOR_PORT=4317
- PROFILE_COLLECTOR_HOST=alloy
- PROFILE_COLLECTOR_PORT=4040
- OTEL_EXPORTER_OTLP_TRACES_INSECURE=true
- OTEL_RESOURCE_ATTRIBUTES=ip=1.2.3.5
# React frontend for the mythical beasts management system
mythical-frontend:
#build:
# context: ./source/mythical-beasts-frontend
# dockerfile: Dockerfile
# args:
# - REACT_APP_API_URL=/api
image: grafana/intro-to-mltp:mythical-beasts-frontend-latest
restart: always
depends_on:
mythical-server:
condition: service_started
alloy:
condition: service_started
ports:
- "3001:80"
# The Tempo service stores traces send to it by Grafana Alloy, and takes
# queries from Grafana to visualise those traces.
tempo:
image: grafana/tempo:2.9.0
ports:
- "3200:3200"
- "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:3.6.3
command: ["--pattern-ingester.enabled=true", "-config.file=/etc/loki/loki.yaml"]
ports:
- "3100:3100"
volumes:
- "./loki/loki.yaml:/etc/loki/loki.yaml"
mimir:
image: grafana/mimir:2.17.4
command: ["-ingester.native-histograms-ingestion-enabled=true", "-config.file=/etc/mimir.yaml"]
ports:
- "9009:9009"
volumes:
- "./mimir/mimir.yaml:/etc/mimir.yaml"
pyroscope:
image: grafana/pyroscope:1.16.2
ports:
- "4040:4040"
command: ["server"]
k6:
image: grafana/k6:1.5.0
volumes:
- "./k6:/scripts"
environment:
- K6_PROMETHEUS_RW_SERVER_URL=http://mimir:9009/api/v1/push
- K6_DURATION=3600s
- K6_VUS=4
- K6_PROMETHEUS_RW_TREND_AS_NATIVE_HISTOGRAM=true
restart: always
command: ["run", "-o", "experimental-prometheus-rw", "/scripts/mythical-loadtest.js"]