forked from qclaogui/codelab-monitoring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yaml
231 lines (218 loc) · 7.66 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
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
# ============================================================================ #
# Microservices Mode - Profiles
# ============================================================================ #
# Note:
# include is available in Docker Compose version 2.20 and later, and Docker Desktop version 4.22 and later.
# docs: https://docs.docker.com/compose/multiple-compose-files/include/#include-and-overrides
include:
- path: ../../common/compose-include/minio.yaml
- path: ../../common/compose-include/memcached.yaml
- path: ../../common/compose-include/mimir.yaml
- path: ../../common/compose-include/grafana.yaml
- path: ../../common/compose-include/alloy.yaml
# https://github.com/qclaogui/codelab-monitoring/blob/main/alloy-modules/compose/README.md
x-labels: &profiles-labels
profiles.grafana.com/cpu.scrape: true
profiles.grafana.com/memory.scrape: true
profiles.grafana.com/goroutine.scrape: true
# Configure a check that's run to determine whether or not containers for this service are "healthy".
# docs: https://docs.docker.com/compose/compose-file/compose-file-v3/#healthcheck
x-healthcheck: &status-healthcheck
interval: 5s
timeout: 2s
retries: 10
configs:
alloy_config_file:
file: ../../common/config/alloy/profiles.alloy
mimir_config_file:
file: ../../common/config/mimir/monolithic-mode-metrics.yaml
pyroscope_config_file:
file: ../../common/config/pyroscope/microservices-mode-profiles.yaml
services:
gateway:
# https://github.com/qclaogui/codelab-monitoring/blob/main/alloy-modules/compose/README.md
labels:
metrics.grafana.com/scrape: false
depends_on: { distributor: { condition: service_healthy } }
image: ${NGINX_IMAGE:-docker.io/nginxinc/nginx-unprivileged:1.25-alpine}
restart: always
volumes:
- ../../common/config/nginx/10-default-lgtmp.envsh:/docker-entrypoint.d/10-default-lgtmp.envsh
- ../../common/config/nginx/nginx.conf:/etc/nginx/templates/nginx.conf.template
- ../../common/config/pyroscope/gateway_pyroscope.conf:/etc/nginx/templates/gateway_pyroscope.conf.template
- ../../common/config/mimir/gateway_mimir.conf:/etc/nginx/templates/gateway_mimir.conf.template
environment:
- PYROSCOPE_DISTRIBUTOR_HOST=distributor
- PYROSCOPE_QUERY_FRONTEND_HOST=query-frontend
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:4040/ || exit 1" ]
interval: 3s
timeout: 1s
retries: 20
ports:
- "34040:4040"
distributor:
labels:
<<: *profiles-labels
profiles.grafana.com/service_name: pyroscope-distributor
depends_on: { ingester: { condition: service_healthy } }
image: &pyroscopeImage ${PYROSCOPE_IMAGE:-docker.io/grafana/pyroscope:1.5.0}
configs:
- source: pyroscope_config_file
target: /etc/pyroscope/config.yaml
volumes:
- ../../common/config/pyroscope:/etc/pyroscope/configs
- pyroscope_data:/data
command:
- -config.file=/etc/pyroscope/config.yaml
- -target=distributor
- -config.expand-env=true
- -memberlist.cluster-label=profiles-system
- -memberlist.join=pyroscope-memberlist:7946
# - -runtime-config.file=/etc/pyroscope/configs/overrides.yaml
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:4040/ready || exit 1" ]
<<: *status-healthcheck
networks:
default:
aliases:
- pyroscope-memberlist
ingester:
labels:
<<: *profiles-labels
profiles.grafana.com/service_name: pyroscope-ingester
depends_on: { minio: { condition: service_healthy } }
image: *pyroscopeImage
configs:
- source: pyroscope_config_file
target: /etc/pyroscope/config.yaml
volumes:
- ../../common/config/pyroscope:/etc/pyroscope/configs
- pyroscope_data:/data
command:
- -config.file=/etc/pyroscope/config.yaml
- -target=ingester
- -config.expand-env=true
- -memberlist.cluster-label=profiles-system
- -memberlist.join=pyroscope-memberlist:7946
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:4040/ready || exit 1" ]
<<: *status-healthcheck
deploy:
replicas: 3
networks:
default:
aliases:
- pyroscope-memberlist
compactor:
labels:
<<: *profiles-labels
profiles.grafana.com/service_name: pyroscope-compactor
depends_on: { minio: { condition: service_healthy } }
image: *pyroscopeImage
configs:
- source: pyroscope_config_file
target: /etc/pyroscope/config.yaml
volumes:
- ../../common/config/pyroscope:/etc/pyroscope/configs
- pyroscope_data:/data
command:
- -config.file=/etc/pyroscope/config.yaml
- -target=compactor
- -config.expand-env=true
- -memberlist.cluster-label=profiles-system
- -memberlist.join=pyroscope-memberlist:7946
deploy:
replicas: 1
networks:
default:
aliases:
- pyroscope-memberlist
query-frontend:
labels:
<<: *profiles-labels
profiles.grafana.com/service_name: pyroscope-query-frontend
image: *pyroscopeImage
configs:
- source: pyroscope_config_file
target: /etc/pyroscope/config.yaml
volumes:
- ../../common/config/pyroscope:/etc/pyroscope/configs
- pyroscope_data:/data
command:
- -config.file=/etc/pyroscope/config.yaml
- -target=query-frontend
- -config.expand-env=true
- -memberlist.cluster-label=profiles-system
- -memberlist.join=pyroscope-memberlist:7946
networks:
default:
aliases:
- pyroscope-memberlist
querier:
labels:
<<: *profiles-labels
profiles.grafana.com/service_name: pyroscope-querier
image: *pyroscopeImage
configs:
- source: pyroscope_config_file
target: /etc/pyroscope/config.yaml
volumes:
- ../../common/config/pyroscope:/etc/pyroscope/configs
- pyroscope_data:/data
command:
- -config.file=/etc/pyroscope/config.yaml
- -target=querier
- -config.expand-env=true
- -memberlist.cluster-label=profiles-system
- -memberlist.join=pyroscope-memberlist:7946
- -store-gateway.sharding-ring.replication-factor=1
networks:
default:
aliases:
- pyroscope-memberlist
query-scheduler:
labels:
<<: *profiles-labels
profiles.grafana.com/service_name: pyroscope-query-scheduler
image: *pyroscopeImage
configs:
- source: pyroscope_config_file
target: /etc/pyroscope/config.yaml
volumes:
- ../../common/config/pyroscope:/etc/pyroscope/configs
- pyroscope_data:/data
command:
- -config.file=/etc/pyroscope/config.yaml
- -target=query-scheduler
- -config.expand-env=true
- -memberlist.cluster-label=profiles-system
- -memberlist.join=pyroscope-memberlist:7946
networks:
default:
aliases:
- pyroscope-memberlist
store-gateway:
labels:
<<: *profiles-labels
profiles.grafana.com/service_name: pyroscope-store-gateway
image: *pyroscopeImage
configs:
- source: pyroscope_config_file
target: /etc/pyroscope/config.yaml
volumes:
- ../../common/config/pyroscope:/etc/pyroscope/configs
- pyroscope_data:/data
command:
- -config.file=/etc/pyroscope/config.yaml
- -target=store-gateway
- -config.expand-env=true
- -memberlist.cluster-label=profiles-system
- -memberlist.join=pyroscope-memberlist:7946
- -store-gateway.sharding-ring.replication-factor=1
networks:
default:
aliases:
- pyroscope-memberlist
volumes:
pyroscope_data: