-
Notifications
You must be signed in to change notification settings - Fork 18
/
monitoring.yml
124 lines (115 loc) · 3.55 KB
/
monitoring.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
#
# This file contains generic monitoring services for FAForever that are not required to run FAF.
#
version: '3.7'
services:
prometheus:
image: prom/prometheus:v2.40.1
deploy:
resources:
limits:
cpus: "1"
command:
# Copied from Dockerfile because we lose existing commands, when defining new ones
# https://github.com/prometheus/prometheus/blob/master/Dockerfile
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
- "--web.console.templates=/usr/share/prometheus/consoles"
# Increase the storage retention to 12 weeks
- "--storage.tsdb.retention.time=12w"
restart: unless-stopped
networks:
# Prometheus needs access to basically all networks in order to scrape the metrics
- monitoring
- faf
extra_hosts:
- "dockerhost:${HOST_IP}"
volumes:
- ./config/monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./data/prometheus:/prometheus
labels:
- "traefik.enable=true"
- "traefik.http.routers.prometheus.rule=Host(`prometheus.${DOMAINNAME}`)"
- "traefik.http.routers.prometheus.entryPoints=websecure"
- "traefik.http.routers.prometheus.middlewares=prometheus-auth"
- "traefik.http.middlewares.prometheus-auth.basicauth.users=${PROMETHEUS_USERNAME}:${PROMETHEUS_PASSWORD}"
- "traefik.http.services.prometheus.loadbalancer.server.port=9090"
promtail:
image: grafana/promtail:2.7.0
volumes:
- ./config/monitoring/promtail:/etc/promtail
- /var/run/docker.sock:/var/run/docker.sock
command: -config.file=/etc/promtail/config.yml
restart: unless-stopped
networks:
- monitoring
loki:
image: grafana/loki:2.7.0
command: -config.file=/etc/loki/config.yml
volumes:
- ./data/loki:/loki
- ./config/monitoring/loki:/etc/loki
networks:
- monitoring
restart: unless-stopped
grafana:
image: grafana/grafana-enterprise:9.2.5
deploy:
resources:
limits:
cpus: "2"
restart: unless-stopped
networks:
- monitoring
volumes:
- ./data/grafana:/var/lib/grafana
env_file: config/monitoring/grafana/grafana.env
labels:
- "traefik.enable=true"
- "traefik.http.routers.grafana.rule=Host(`grafana.${DOMAINNAME}`)"
- "traefik.http.routers.grafana.entryPoints=websecure"
- "traefik.http.services.grafana.loadbalancer.server.port=3000"
mysql-exporter:
image: prom/mysqld-exporter
restart: unless-stopped
networks:
# mysqld-exporter needs access to the MySQL database
- monitoring
- faf
env_file: config/monitoring/mysql-exporter/mysql-exporter.env
expose:
- "9104"
command: >-
--collect.binlog_size
--collect.auto_increment.columns
--collect.info_schema.processlist
--collect.info_schema.tables
--collect.info_schema.tablestats
--collect.info_schema.userstats
--collect.info_schema.query_response_time
node-exporter:
image: prom/node-exporter
restart: unless-stopped
expose:
- "9100"
networks:
- monitoring
cadvisor:
image: gcr.io/cadvisor/cadvisor
command: "--max_procs=1"
restart: unless-stopped
networks:
- monitoring
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
expose:
- "8080"
networks:
monitoring:
driver: bridge
faf:
driver: bridge