-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.metrics.example.yml
74 lines (74 loc) · 1.66 KB
/
docker-compose.metrics.example.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
version: '3.9'
services:
scraper:
image: prom/prometheus:latest
container_name: scraper
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=30d'
volumes:
- type: bind
source: ./config/prometheus.yml
target: /etc/prometheus/prometheus.yml
read_only: true
- prometheus-data:/prometheus
ports:
- "9090:9090"
networks:
- metrics-network
- monitoring
depends_on:
- node_exporter
- cadvisor
restart: unless-stopped
grafana:
image: grafana/grafana-oss:latest
container_name: grafana
ports:
- '3000:3000'
volumes:
- grafana-data:/var/lib/grafana
restart: unless-stopped
networks:
- monitoring
depends_on:
- scraper
#password: root123
node_exporter:
image: quay.io/prometheus/node-exporter:latest
container_name: node_exporter
command: '--path.rootfs=/host'
pid: host
# network_mode: host
restart: unless-stopped
volumes:
- /:/host:ro,rslave
networks:
- monitoring
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
container_name: cadvisor
command:
- '-port=8098'
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
devices:
- /dev/kmsg
privileged: true
restart: unless-stopped
networks:
- monitoring
volumes:
prometheus-data: {}
grafana-data: {}
networks:
metrics-network:
name: metrics-network
driver: bridge
monitoring:
driver: bridge