-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathcompose.yaml
More file actions
452 lines (395 loc) · 11 KB
/
compose.yaml
File metadata and controls
452 lines (395 loc) · 11 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
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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
# This compose file is meant as development support, not production deployment. It runs the
# monitoring stack primarily.
services:
leaf-server:
image: ghcr.io/muni-town/leaf:sha-d54ee4f
platform: linux/amd64 # no arm64 build available
# Uncomment if you are also dev-ing the leaf server
# scale: 0
volumes:
- leaf-data:/data
ports:
- 5530:5530
environment:
http_proxy:
https_proxy:
DID: did:web:localhost
PLC_DIRECTORY: http://plc-directory:3000
ENDPOINT: http://locahost:5530
networks:
- roomy-dev
plc-directory:
image: ghcr.io/zicklag/did-plc-server:plc-053ddecb6a12ce0e996d300f9395899adf02dd05
platform: linux/amd64 # no arm64 build available
command:
- node
- ../dist/bin.js
ports:
- 3001:3000
environment:
NODE_ENV: dev
DATABASE_URL: "postgres://postgres:password@plc-db"
DEBUG_MODE: 1
LOG_ENABLED: "true"
LOG_LEVEL: debug
LOG_DESTINATION: 1
networks:
- roomy-dev
plc-db:
image: postgres
platform: linux/amd64 # no arm64 build available for plc-directory
environment:
POSTGRES_PASSWORD: password
volumes:
- plc-db-data:/var/lib/postgresql
networks:
- roomy-dev
pyroscope:
image: grafana/pyroscope:latest
ports:
- "4040:4040"
networks:
- roomy-dev
tempo:
image: grafana/tempo:2.9.1
command: ["-config.file=/etc/tempo.yaml"]
configs:
- source: tempo-config
target: /etc/tempo.yaml
ports:
- "3200:3200"
networks:
- roomy-dev
loki:
image: grafana/loki:latest
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml
configs:
- source: loki-config
target: /etc/loki/local-config.yaml
networks:
- roomy-dev
mimir:
image: grafana/mimir:latest
ports:
- 9009:9009
configs:
- source: mimir-config
target: /etc/mimir/demo.yaml
command: --config.file=/etc/mimir/demo.yaml
networks:
- roomy-dev
alloy:
image: grafana/alloy:latest
command: run --disable-reporting --server.http.listen-addr=0.0.0.0:5005 /etc/alloy/config.alloy
ports:
- 5005:5005 # Alloy
- 12345:12345 # Faro
- 4317:4317 # OTLP
configs:
- source: alloy-config
target: /etc/alloy/config.alloy
networks:
- roomy-dev
grafana:
image: grafana/grafana:12.3.0
configs:
- source: grafana-datasources
target: /etc/grafana/provisioning/datasources/datasources.yaml
volumes:
- ./gitignore/ca-certificates.crt:/usr/local/share/ca-certificates/cert.crt
environment:
- http_proxy
- https_proxy
- no_proxy=pyroscope,tempo,mimir,loki
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_DISABLE_LOGIN_FORM=true
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor
- GF_INSTALL_PLUGINS=grafana-pyroscope-app
user: root
entrypoint:
- bash
- -c
- update-ca-certificates && exec bash /run.sh
ports:
- "3000:3000"
networks:
- roomy-dev
volumes:
leaf-data:
plc-db-data:
pds-data:
networks:
roomy-dev:
name: roomy-dev
external: true
configs:
loki-config:
content: |
# This is a complete configuration to deploy Loki backed by the filesystem.
# The index will be shipped to the storage via tsdb-shipper.
auth_enabled: false
server:
http_listen_port: 3100
common:
ring:
instance_addr: 127.0.0.1
kvstore:
store: inmemory
replication_factor: 1
path_prefix: /tmp/loki
schema_config:
configs:
- from: 2020-05-15
store: tsdb
object_store: filesystem
schema: v13
index:
prefix: index_
period: 24h
storage_config:
filesystem:
directory: /tmp/loki/chunks
mimir-config:
content: |
multitenancy_enabled: false
blocks_storage:
backend: filesystem
bucket_store:
sync_dir: /tmp/mimir/tsdb-sync
filesystem:
dir: /tmp/mimir/data/tsdb
tsdb:
dir: /tmp/mimir/tsdb
compactor:
data_dir: /tmp/mimir/compactor
sharding_ring:
kvstore:
store: memberlist
distributor:
ring:
instance_addr: 127.0.0.1
kvstore:
store: memberlist
ingester:
ring:
instance_addr: 127.0.0.1
kvstore:
store: memberlist
replication_factor: 1
ruler_storage:
backend: filesystem
filesystem:
dir: /tmp/mimir/rules
server:
http_listen_port: 9009
log_level: info
store_gateway:
sharding_ring:
replication_factor: 1
alloy-config:
content: |
// Write metrics to mimir
prometheus.remote_write "mimir" {
endpoint {
name = "default"
url = "http://mimir:9009/api/v1/push"
queue_config { }
metadata_config { }
}
}
// Write traces to tempo
otelcol.exporter.otlp "tempo" {
retry_on_failure {
max_elapsed_time = "1m0s"
}
client {
endpoint = "tempo:4317"
tls {
insecure = true
insecure_skip_verify = true
}
}
}
// Write logs to loki
loki.write "loki" {
endpoint {
url = "http://loki:3100/loki/api/v1/push"
}
}
loki.process "frontend" {
forward_to = [loki.write.loki.receiver]
stage.logfmt {
mapping = { "service_name" = "app_name", kind = "" }
}
stage.labels {
values = { "kind" = "kind", "service_name" = "service_name", "app" = "service_name" }
}
// Make sure exceptions are logged at an error level instead of "unknown"
stage.match {
selector = "{kind=\"exception\"}"
stage.template {
source = "const_error"
template = "error"
}
stage.structured_metadata {
values = {
"level" = "const_error",
}
}
}
}
logging {
level = "info"
}
// Receive logs & traces from faro agent
faro.receiver "frontend" {
server {
listen_address = "0.0.0.0"
listen_port = 12345
cors_allowed_origins = ["http://127.0.0.1:5173"]
api_key = "bad_api_key"
max_allowed_payload_size = "10MiB"
rate_limiting {
rate = 100
}
}
sourcemaps { }
output {
logs = [loki.process.frontend.receiver]
traces = [otelcol.exporter.otlp.tempo.input]
}
}
// Recieve OTLP data
otelcol.receiver.otlp "default" {
grpc {
include_metadata = true
}
output {
// Batch metrics
metrics = [otelcol.processor.batch.default.input]
// Convert logs to loki
logs = [otelcol.exporter.loki.default.input]
// Send traces to tempo
traces = [otelcol.exporter.otlp.tempo.input]
}
}
// Batch metrics
otelcol.processor.batch "default" {
output {
// Convert batched metrics to prometheus
metrics = [otelcol.exporter.prometheus.default.input]
}
}
// Convert metrics to prometheus
otelcol.exporter.prometheus "default" {
forward_to = [prometheus.remote_write.mimir.receiver]
}
// Convert logs to loki
otelcol.exporter.loki "default" {
forward_to = [loki.write.loki.receiver]
}
tempo-config:
content: |
stream_over_http_enabled: true
server:
http_listen_port: 3200
log_level: info
query_frontend:
search:
duration_slo: 5s
throughput_bytes_slo: 1.073741824e+09
metadata_slo:
duration_slo: 5s
throughput_bytes_slo: 1.073741824e+09
trace_by_id:
duration_slo: 5s
distributor:
receivers:
otlp:
protocols:
grpc:
endpoint: "tempo:4317"
ingester:
max_block_duration: 5m # cut the headblock when this much time passes. this is being set for demo purposes and should probably be left alone normally
compactor:
compaction:
block_retention: 1h # overall Tempo trace retention. set for demo purposes
metrics_generator:
registry:
external_labels:
source: tempo
cluster: docker-compose
storage:
path: /var/tempo/generator/wal
remote_write:
- url: http://prometheus:9090/api/v1/write
send_exemplars: true
traces_storage:
path: /var/tempo/generator/traces
storage:
trace:
backend: local # backend configuration to use
wal:
path: /var/tempo/wal # where to store the wal locally
local:
path: /var/tempo/blocks
overrides:
defaults:
metrics_generator:
processors: [service-graphs, span-metrics, local-blocks] # enables metrics generator
generate_native_histograms: both
grafana-datasources:
content: |
apiVersion: 1
datasources:
- name: Pyroscope
uid: pyroscope
type: grafana-pyroscope-datasource
typeName: Pyroscope
access: proxy
url: http://pyroscope:4040
- name: Mimir
uid: mimir
type: prometheus
typeName: Prometheus
access: proxy
url: http://mimir:9009/prometheus
basicAuth: false
readOnly: true
- name: Loki
type: loki
access: proxy
uid: loki
url: http://loki:3100
basicAuth: false
version: 1
editable: false
- name: Tempo
type: tempo
access: proxy
orgId: 1
url: http://tempo:3200
basicAuth: false
isDefault: true
version: 1
editable: false
apiVersion: 1
uid: tempo
jsonData:
{
"streamingEnabled": {
"metrics": true,
"search": true
},
"tracesToMetrics": {
"datasourceUid": "mimir"
},
"tracesToProfiles":
{
"datasourceUid": "pyroscope",
"profileTypeId": "process_cpu:cpu:nanoseconds:cpu:nanoseconds",
},
}