-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathdocker-compose-metrics.yml
200 lines (189 loc) · 5.05 KB
/
docker-compose-metrics.yml
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
version: '3.5'
services:
dockerd-exporter:
image: stefanprodan/dockerd-exporter:latest
networks:
- metrics
# environment:
# - IN=172.18.0.1:9323
deploy:
mode: global
resources:
limits:
memory: 128M
reservations:
memory: 64M
node-exporter:
image: flaviostutz/docker-swarm-node-exporter:1.1.1
environment:
- NODE_ID={{.Node.ID}}
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
- /etc/hostname:/etc/nodename
networks:
- metrics
deploy:
mode: global
resources:
limits:
memory: 128M
reservations:
memory: 64M
cadvisor:
image: google/cadvisor:v0.33.0
command: -logtostderr -docker_only
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /:/rootfs:ro
- /var/run:/var/run
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
networks:
- metrics
deploy:
mode: global
resources:
limits:
memory: 128M
reservations:
memory: 64M
perfstat:
image: flaviostutz/perfstat:v0.4.0
# privileged: true
volumes:
- /etc/hostname:/etc/hostname
networks:
- metrics
deploy:
mode: global
resources:
limits:
memory: 128M
reservations:
memory: 64M
alertmanager:
image: stefanprodan/swarmprom-alertmanager:v0.15.3
environment:
- SLACK_URL=${SLACK_URL:-https://hooks.slack.com/services/TOKEN}
- SLACK_CHANNEL=${SLACK_CHANNEL:-general}
- SLACK_USER=${SLACK_USER:-alertmanager}
command:
- '--config.file=/etc/alertmanager/alertmanager.yml'
- '--storage.path=/alertmanager'
volumes:
- alertmanager:/alertmanager
networks:
- metrics
- caddy
deploy:
labels:
- caddy=http://alertmanager.${CLUSTER_DOMAIN} https://alertmanager.${CLUSTER_DOMAIN}
- caddy.reverse_proxy={{upstreams 9093}}
- caddy.encode=gzip
- caddy.basicauth=/*
- caddy.basicauth.admin=JDJhJDEwJGZFS3ZIdFpIek9sNG1RMk5zQm0xVnV5S2VyQkJPS3lRV3h0Y1pwSTA4cUNFd1IwcVFNMGxP
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
resources:
limits:
memory: 128M
reservations:
memory: 64M
unsee:
image: cloudflare/unsee:v0.9.2
environment:
- "ALERTMANAGER_URIS=default:http://alertmanager:9093"
networks:
- metrics
- caddy
deploy:
labels:
- caddy=http://unsee.${CLUSTER_DOMAIN} https://unsee.${CLUSTER_DOMAIN}
- caddy.reverse_proxy={{upstreams 8080}}
- caddy.encode=gzip
- caddy.basicauth=/*
- caddy.basicauth.admin=JDJhJDEwJGZFS3ZIdFpIek9sNG1RMk5zQm0xVnV5S2VyQkJPS3lRV3h0Y1pwSTA4cUNFd1IwcVFNMGxP
mode: replicated
replicas: 1
resources:
limits:
memory: 128M
reservations:
memory: 64M
placement:
constraints:
- node.role == manager
prometheus:
image: flaviostutz/prometheus:2.20.1.0
environment:
- SCRAPE_INTERVAL=15s
- SCRAPE_TIMEOUT=10s
- ALERTMANAGER_TARGETS=alertmanager:9093
# - STATIC_SCRAPE_TARGETS=traefik@traefik:80
- DNS_SCRAPE_TARGETS=dockerd-exporter@tasks.dockerd-exporter:9323/metrics cadvisor@tasks.cadvisor:8080/metrics node-exporter@tasks.node-exporter:9100/metrics perfstat@tasks.perfstat:8880/metrics
volumes:
- prometheus:/prometheus
networks:
- metrics
- caddy
deploy:
labels:
- caddy=http://prometheus.${CLUSTER_DOMAIN} https://prometheus.${CLUSTER_DOMAIN}
- caddy.reverse_proxy={{upstreams 9090}}
- caddy.encode=gzip
- caddy.basicauth=/*
- caddy.basicauth.admin=JDJhJDEwJGZFS3ZIdFpIek9sNG1RMk5zQm0xVnV5S2VyQkJPS3lRV3h0Y1pwSTA4cUNFd1IwcVFNMGxP
#admin/admin123admin123
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
resources:
limits:
memory: 2048M
reservations:
memory: 128M
grafana:
image: flaviostutz/docker-swarm-grafana:7.1.3.3
environment:
- GF_SECURITY_ADMIN_USER=${ADMIN_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- grafana:/var/lib/grafana
ports:
- 9191:3000
networks:
- metrics
- caddy
deploy:
labels:
- caddy=http://grafana.${CLUSTER_DOMAIN} https://grafana.${CLUSTER_DOMAIN}
- caddy.reverse_proxy={{upstreams 3000}}
- caddy.encode=gzip
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
resources:
limits:
memory: 128M
reservations:
memory: 64M
networks:
caddy:
external: true
metrics:
external: true
# "docker network create metrics --scope swarm -d overlay"
volumes:
prometheus:
grafana:
alertmanager: