-
-
Notifications
You must be signed in to change notification settings - Fork 85
/
docker-compose.yaml
121 lines (108 loc) · 3.36 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
x-logging: &default-logging
driver: loki
options:
loki-url: 'http://localhost:3100/api/prom/push'
loki-pipeline-stages: |
- multiline:
firstline: '^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}'
max_wait_time: 3s
- regex:
expression: '^(?P<date>\d{4}-\d{2}-\d{2}) (?P<time>\d{2}:\d{2}:\d{2}.\d{3}) (?P<message>(?s:.*))$$'
version: "3.4"
services:
# Infrastructure
loki:
image: grafana/loki:3.0.0
command: -config.file=/etc/loki/local-config.yaml
ports:
- "3100:3100"
prometheus:
image: prom/prometheus:v2.51.2
ports:
- "9090:9090"
volumes:
- ./etc/prometheus:/workspace
command:
- --config.file=/workspace/prometheus.yml
- --enable-feature=exemplar-storage
depends_on:
- loki
logging: *default-logging
tempo:
image: grafana/tempo:2.4.1
command: [ "--target=all", "--storage.trace.backend=local", "--storage.trace.local.path=/var/tempo", "--auth.enabled=false" ]
ports:
- "14250:14250"
- "4317:4317"
depends_on:
- loki
logging: *default-logging
grafana:
image: grafana/grafana:10.4.2
ports:
- "3000:3000"
volumes:
- ./etc/grafana/:/etc/grafana/provisioning/datasources
- ./etc/dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml
- ./etc/dashboards:/etc/grafana/dashboards
depends_on:
- loki
- prometheus
logging: *default-logging
# Applications
app-a:
# build: ./app/
image: ghcr.io/blueswen/spring-boot-observability/app:latest
environment:
- TARGET_ONE_HOST=app-b
- TARGET_TWO_HOST=app-c
- OTEL_EXPORTER_OTLP_ENDPOINT=http://tempo:4317 # send traces to Tempo
- OTEL_SERVICE_NAME=app-a # service name for Span
- OTEL_RESOURCE_ATTRIBUTES=compose_service=app-a # add custom resource attribute to Span for Grafana Trace to Logs feature
- OTEL_METRICS_EXPORTER=none # disable metrics exporter
- MANAGEMENT_METRICS_TAGS_APPLICATION=app-a # override default value of management.metrics.tags.application in app/src/main/resources/application.properties
ports:
- "8080:8080"
logging: *default-logging
app-b:
# build: ./app/
image: ghcr.io/blueswen/spring-boot-observability/app:latest
environment:
- TARGET_ONE_HOST=app-b
- TARGET_TWO_HOST=app-c
- OTEL_EXPORTER_OTLP_ENDPOINT=http://tempo:4317
- OTEL_SERVICE_NAME=app-b
- OTEL_RESOURCE_ATTRIBUTES=compose_service=app-b
- OTEL_METRICS_EXPORTER=none
- MANAGEMENT_METRICS_TAGS_APPLICATION=app-b
ports:
- "8081:8080"
logging: *default-logging
app-c:
# build: ./app/
image: ghcr.io/blueswen/spring-boot-observability/app:latest
environment:
- TARGET_ONE_HOST=app-b
- TARGET_TWO_HOST=app-c
- OTEL_EXPORTER_OTLP_ENDPOINT=http://tempo:4317
- OTEL_SERVICE_NAME=app-c
- OTEL_RESOURCE_ATTRIBUTES=compose_service=app-c
- OTEL_METRICS_EXPORTER=none
- MANAGEMENT_METRICS_TAGS_APPLICATION=app-c
ports:
- "8082:8080"
logging: *default-logging
postgres:
image: postgres:16.2
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
ports:
- "5432:5432"
logging: *default-logging
redis:
image: redis:7.2.4
ports:
- "6379:6379"
logging: *default-logging