-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcompose.yaml
195 lines (183 loc) · 6.94 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
# ============================================================================ #
# Monolithic Mode - All in one
# ============================================================================ #
# 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/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
x-environment: &jaeger-environment
JAEGER_AGENT_HOST: alloy
JAEGER_AGENT_PORT: 6831
JAEGER_SAMPLER_TYPE: const
JAEGER_SAMPLER_PARAM: 1
# 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: 3s
timeout: 1s
retries: 15
configs:
alloy_config_file:
file: ../../common/config/alloy/all-in-one.alloy
loki_config_file:
file: ../../common/config/loki/monolithic-mode-logs.yaml
tempo_config_file:
file: ../../common/config/tempo/monolithic-mode-traces.yaml
mimir_config_file:
file: ../../common/config/mimir/monolithic-mode-metrics.yaml
pyroscope_config_file:
file: ../../common/config/pyroscope/monolithic-mode-profiles.yaml
services:
gateway:
labels:
metrics.grafana.com/scrape: false
depends_on: {tempo: {condition: service_healthy}, mimir: {condition: service_healthy}, pyroscope: {condition: service_healthy}}
image: ${NGINX_IMAGE:-docker.io/nginxinc/nginx-unprivileged:1.27-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/loki/gateway_loki.conf:/etc/nginx/templates/gateway_loki.conf.template
- ../../common/config/tempo/gateway_tempo.conf:/etc/nginx/templates/gateway_tempo.conf.template
- ../../common/config/mimir/gateway_mimir.conf:/etc/nginx/templates/gateway_mimir.conf.template
- ../../common/config/pyroscope/gateway_pyroscope.conf:/etc/nginx/templates/gateway_pyroscope.conf.template
healthcheck:
test: ["CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/"]
interval: 3s
timeout: 1s
retries: 20
loki:
labels:
<<: *profiles-labels
metrics.grafana.com/scrape: false
profiles.grafana.com/service_name: loki
depends_on: {minio: {condition: service_healthy}}
image: ${LOKI_IMAGE:-docker.io/grafana/loki:3.3.2}
configs:
- source: loki_config_file
target: /etc/loki/config.yaml
volumes:
- ../../common/config/loki:/etc/loki/configs
command:
- -config.file=/etc/loki/config.yaml
- -target=all
- -config.expand-env=true
environment:
<<: *jaeger-environment
JAEGER_TAGS: app=loki
healthcheck:
test: ["CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3100/ready"]
<<: *status-healthcheck
# expose 33100 port so we can directly access loki inside container
ports:
- "33100:3100"
networks:
default:
aliases:
- loki-memberlist
tempo:
labels:
<<: *profiles-labels
metrics.grafana.com/scrape: false
profiles.grafana.com/service_name: tempo
depends_on: {minio: {condition: service_healthy}, mimir: {condition: service_healthy}}
image: ${TEMPO_IMAGE:-docker.io/grafana/tempo:2.6.0}
configs:
- source: tempo_config_file
target: /etc/tempo/config.yaml
volumes:
- ../../common/config/tempo:/etc/tempo/configs
command:
- -config.file=/etc/tempo/config.yaml
- -target=all
- -config.expand-env=true
environment:
<<: *jaeger-environment
JAEGER_TAGS: app=tempo
healthcheck:
test: ["CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3200/ready"]
<<: *status-healthcheck
start_period: 10s
# expose 33200 port so we can directly access tempo inside container
ports:
- "33200:3200"
mimir:
labels:
<<: *profiles-labels
metrics.grafana.com/scrape: false
profiles.grafana.com/service_name: mimir
depends_on: {minio: {condition: service_healthy}}
image: ${MIMIR_IMAGE:-docker.io/grafana/mimir-alpine:2.14.0}
configs:
- source: mimir_config_file
target: /etc/mimir/config.yaml
volumes:
- ../../common/config/mimir:/etc/mimir/configs
command:
- -config.file=/etc/mimir/config.yaml
- -target=all
- -config.expand-env=true
- -ruler.max-rules-per-rule-group=50
environment:
<<: *jaeger-environment
JAEGER_TAGS: app=mimir
healthcheck:
test: ["CMD", "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/ready"]
<<: *status-healthcheck
# expose 38080 port so we can directly access mimir inside container
ports:
- "38080:8080"
networks:
default:
aliases:
- mimir-memberlist
mimirtool:
labels:
metrics.grafana.com/scrape: false
image: ${MIMIRTOOL_IMAGE:-docker.io/grafana/mimirtool:2.14.0}
volumes:
- ../../../monitoring-mixins/crontab:/etc/crontabs/root
- ../../../monitoring-mixins/alloy-mixin/deploy/alloy-mixin-alerts.yaml:/rules/alloy-mixin-alerts.yaml
# - ../../../monitoring-mixins/memcached-mixin/deploy/memcached-mixin-alerts.yaml:/rules/memcached-mixin-alerts.yaml
environment:
- MIMIR_ADDRESS=http://gateway:8080
- MIMIR_TENANT_ID=anonymous
entrypoint: crond -f
restart: always
pyroscope:
labels:
metrics.grafana.com/scrape: false
profiles.grafana.com/service_name: pyroscope
depends_on: {minio: {condition: service_healthy}}
image: ${PYROSCOPE_IMAGE:-docker.io/grafana/pyroscope:1.10.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=all
- -config.expand-env=true
# - -runtime-config.file=/etc/pyroscope/configs/overrides.yaml
environment:
<<: *jaeger-environment
JAEGER_TAGS: app=pyroscope
healthcheck:
test: ["CMD", "profilecli", "ready"]
<<: *status-healthcheck
# expose 34040 port so we can directly access pyroscope inside container
ports:
- "34040:4040"
volumes:
pyroscope_data: {}