prometheus: move node-exporter to the host network for accurate traffic stats
This commit is contained in:
parent
402ffae6e7
commit
08123757cd
2 changed files with 6 additions and 9 deletions
|
@ -254,8 +254,9 @@ services:
|
||||||
- "traefik.http.routers.prometheus_app.tls.certresolver=myresolver"
|
- "traefik.http.routers.prometheus_app.tls.certresolver=myresolver"
|
||||||
- "traefik.http.routers.prometheus_app.middlewares=traefik_api_auth"
|
- "traefik.http.routers.prometheus_app.middlewares=traefik_api_auth"
|
||||||
- "traefik.http.services.prometheus_app.loadbalancer.server.port=9090"
|
- "traefik.http.services.prometheus_app.loadbalancer.server.port=9090"
|
||||||
#extra_hosts:
|
extra_hosts:
|
||||||
# - "host.docker.internal:host-gateway"
|
# To be able to reach node-exporter which listens on the host network.
|
||||||
|
- "host.docker.internal:host-gateway"
|
||||||
|
|
||||||
grafana:
|
grafana:
|
||||||
image: grafana/grafana
|
image: grafana/grafana
|
||||||
|
@ -289,19 +290,15 @@ services:
|
||||||
container_name: node-exporter
|
container_name: node-exporter
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
<<: *logging
|
<<: *logging
|
||||||
#network_mode: host
|
# Put node-exporter on the host network to get meaningful network stats.
|
||||||
|
network_mode: host
|
||||||
pid: host
|
pid: host
|
||||||
volumes:
|
volumes:
|
||||||
#- /proc:/host/proc:ro
|
|
||||||
#- /sys:/host/sys:ro
|
|
||||||
- /:/rootfs:ro,rslave
|
- /:/rootfs:ro,rslave
|
||||||
- /etc/timezone:/etc/timezone:ro
|
- /etc/timezone:/etc/timezone:ro
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
command:
|
command:
|
||||||
#- '--path.procfs=/host/proc'
|
|
||||||
- '--path.rootfs=/rootfs'
|
- '--path.rootfs=/rootfs'
|
||||||
#- '--path.sysfs=/host/sys'
|
|
||||||
#- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
|
|
||||||
expose:
|
expose:
|
||||||
- 9100
|
- 9100
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ scrape_configs:
|
||||||
|
|
||||||
- job_name: 'node'
|
- job_name: 'node'
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: ['node-exporter:9100']
|
- targets: ['host.docker.internal:9100']
|
||||||
|
|
||||||
- job_name: 'loki'
|
- job_name: 'loki'
|
||||||
static_configs:
|
static_configs:
|
||||||
|
|
Loading…
Reference in a new issue