-
Notifications
You must be signed in to change notification settings - Fork 155
Expand file tree
/
Copy pathdocker-compose-otel.yml
More file actions
182 lines (171 loc) · 5.6 KB
/
Copy pathdocker-compose-otel.yml
File metadata and controls
182 lines (171 loc) · 5.6 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
name: grafana-intro-to-mltp-otel
volumes:
grafana:
postgres:
services:
# The opentelemetry-collector batches and processes traces sent to it.
opentelemetry-collector:
image: otel/opentelemetry-collector-contrib:0.154.0
ports:
- "12347:12345"
- "12348:12348"
- "6832:6832"
- "55679:55679"
- "4317:4317"
- "4318:4318"
volumes:
- ./otel/otel.yml:/etc/otel-collector-config.yml
command: ["--config=/etc/otel-collector-config.yml"]
# The Grafana dashboarding server.
grafana:
image: grafana/grafana:13.0.2
volumes:
- "./grafana/definitions:/var/lib/grafana/dashboards"
- "./grafana/provisioning:/etc/grafana/provisioning"
ports:
- "3000:3000"
environment:
- GF_FEATURE_TOGGLES_ENABLE=flameGraph traceqlSearch correlations traceQLStreaming 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:18.4
restart: always
environment:
POSTGRES_PASSWORD: "mythical"
volumes:
- "postgres:/var/lib/postgresql"
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: ghcr.io/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://loki:3100/loki/api/v1/push
- TRACING_COLLECTOR_HOST=opentelemetry-collector
- TRACING_COLLECTOR_PORT=4317
- PROFILE_COLLECTOR_HOST=pyroscope
- PROFILE_COLLECTOR_PORT=4040
- 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 opentelemetry-collector instance.
mythical-server:
#build:
# context: ./source
# dockerfile: docker/Dockerfile
# args:
# SERVICE: mythical-beasts-server
image: ghcr.io/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://loki:3100/loki/api/v1/push
- TRACING_COLLECTOR_HOST=opentelemetry-collector
- TRACING_COLLECTOR_PORT=4317
- PROFILE_COLLECTOR_HOST=pyroscope
- PROFILE_COLLECTOR_PORT=4040
- 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: ghcr.io/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://loki:3100/loki/api/v1/push
- TRACING_COLLECTOR_HOST=opentelemetry-collector
- TRACING_COLLECTOR_PORT=4317
- PROFILE_COLLECTOR_HOST=pyroscope
- PROFILE_COLLECTOR_PORT=4040
- OTEL_EXPORTER_OTLP_TRACES_INSECURE=true
- OTEL_RESOURCE_ATTRIBUTES=ip=1.2.3.5
# The Tempo service stores traces send to it by Grafana opentelemetry-collector, and takes
# queries from Grafana to visualise those traces.
tempo:
image: grafana/tempo:3.0.2
ports:
- "3200:3200"
- "55680:55680"
- "55681:55681"
- "14250:14250"
command: [ "-target=all", "-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.7.2
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:3.1.0
command: ["-target=all", "-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:2.1.0
ports:
- "4040:4040"
command: ["server"]
k6:
image: grafana/k6:1.7.1
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"]