-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
156 lines (151 loc) · 3.91 KB
/
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
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
version: '3'
services:
postgres:
image: postgres:14.2
container_name: postgres
deploy:
resources:
limits:
cpus: '0.1'
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=petclinic
- POSTGRES_USER=petclinic
volumes:
- db_data:/var/lib/postgresql/data
networks:
- petnet
petclinic:
depends_on:
- postgres
- tempo
image: ghcr.io/dmt/petclinic-grafana:latest
# run as root to be able to write log files into the mount. meh
user: root
container_name: petclinic
working_dir: /app
restart: unless-stopped
environment:
- SPRING_PROFILES_ACTIVE=postgres,o11y,local
- POSTGRES_URL=jdbc:postgresql://postgres/petclinic
- JAVA_TOOL_OPTIONS="-Xmx512M"
ports:
- "8080:8080"
networks:
petnet:
volumes:
- app_logs:/app/logs
- ./compose/spring:/app/config
prometheus:
image: prom/prometheus
container_name: prometheus
command: [
"--config.file=/etc/prometheus/prometheus.yml",
"--enable-feature=exemplar-storage",
"--web.enable-remote-write-receiver",
"--enable-feature=native-histograms"
]
ports:
- "9090:9090"
restart: unless-stopped
volumes:
- ./compose/config/prometheus.yml:/etc/prometheus/prometheus.yml
- prom_data:/prometheus
networks:
- petnet
grafana:
image: grafana/grafana:latest-ubuntu
container_name: grafana
ports:
- "3000:3000"
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=grafana
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_FEATURE_TOGGLES_ENABLE=traceToMetrics,featureToggleAdminPage
volumes:
# Pre-load the data sources
- ./compose/config/grafana-datasources.yml:/etc/grafana/provisioning/datasources/datasources.yaml:rw
# Pre-load the Hello Observability dashboard
- ./compose/grafana/dashboards:/etc/grafana/provisioning/dashboards
# internal storage for among other things annotations
- grafana_data:/var/lib/grafana
networks:
- petnet
tempo:
image: grafana/tempo:latest
container_name: tempo
command: [ "-config.file=/etc/tempo.yaml" ]
# tempo seems to take 30s to shut down. Who's got that much time?
stop_grace_period: 2s
# to be able to write to the data mount
user: root
restart: unless-stopped
volumes:
- ./compose/config/tempo-local.yaml:/etc/tempo.yaml
- tempo_data:/tmp/tempo
ports:
- "9411:9411" # zipkin
- "3200:3200" # http
networks:
- petnet
promtail:
image: grafana/promtail:latest
container_name: promtail
command: [ "-config.file=/etc/promtail/config.yaml" ]
depends_on:
- petclinic
volumes:
- ./compose/config/promtail.yaml:/etc/promtail/config.yaml
# mount logs from the app's container
- app_logs:/mnt/container/logs:ro
- tail_data:/tmp
networks:
- petnet
loki:
image: grafana/loki:latest
container_name: loki
ports:
- "3100:3100"
command: [
"-config.file=/etc/loki/local-config.yaml",
"-ingester.max-global-streams-per-user=0",
"-distributor.ingestion-rate-limit-mb=100",
"-reporting.enabled=false"
]
networks:
- petnet
k6:
image: grafana/k6:master-with-browser
command: [
"run",
"-o",
"experimental-prometheus-rw",
"script.js"
]
container_name: k6-tests
restart: "no"
volumes:
- .:/app
working_dir: /app
environment:
- K6_PROMETHEUS_RW_SERVER_URL=http://prometheus:9090/api/v1/write
- K6_PROMETHEUS_RW_TREND_AS_NATIVE_HISTOGRAM=true
depends_on:
- petclinic
networks:
- petnet
profiles:
- k6-tests
volumes:
db_data:
prom_data:
tempo_data:
tail_data:
app_logs:
grafana_data:
networks:
petnet: