-
Notifications
You must be signed in to change notification settings - Fork 3
/
prometheus.yml
64 lines (60 loc) · 1.85 KB
/
prometheus.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
x-logging: &logging
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'
services:
prometheus:
restart: unless-stopped
build:
context: ./prometheus
image: prometheus:vd-local
pull_policy: never
volumes:
- ./prometheus/file_sd:/etc/prometheus/file_sd
- prometheus-data:/prometheus
- ./prometheus/custom-prom.yml:/etc/prometheus/custom-prom.yml:ro
- /etc/localtime:/etc/localtime:ro
environment:
- CLIENT=${COMPOSE_FILE}
entrypoint: choose-config.sh
command: ["/bin/prometheus", "--storage.tsdb.path=/prometheus", "--web.console.libraries=/usr/share/prometheus/console_libraries", "--web.console.templates=/usr/share/prometheus/consoles"]
<<: *logging
depends_on:
- node-exporter
node-exporter:
image: quay.io/prometheus/node-exporter:latest
command:
- '--path.rootfs=/host'
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.ignored-mount-points=^/(dev|proc|sys|run|var/lib/docker/.+)($$|/)'
- '--no-collector.ipvs'
pid: host
restart: unless-stopped
volumes:
- '/:/host:ro,rslave'
- /etc/hostname:/etc/nodename:ro
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /etc/localtime:/etc/localtime:ro
<<: *logging
promtail:
image: grafana/promtail:latest
user: root
volumes:
- /etc/machine-id:/etc/machine-id:ro
- ./promtail:/etc/promtail
- promtail-data:/tmp
- /var/lib/docker/containers:/var/lib/docker/containers:ro
entrypoint: ./etc/promtail/entrypoint.sh
command: ["/usr/bin/promtail"]
environment:
SERVER_LABEL_HOSTNAME: ${LOGS_LABEL:-notset}
restart: "unless-stopped"
<<: *logging
volumes:
prometheus-data:
promtail-data: