Skip to content

Commit

Permalink
added cadvisor
Browse files Browse the repository at this point in the history
Cadvisors suggested setup didn't work. I followed this suggestion:
google/cadvisor#2838 (comment)
  • Loading branch information
vasconsaurus committed Feb 15, 2023
1 parent 52ed68c commit 7a2081b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
29 changes: 29 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,32 @@ services:
- --config.file=/etc/prometheus/prometheus.yml
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
depends_on:
- cadvisor
# cadvisor:
# image: gcr.io/cadvisor/cadvisor:latest
# container_name: cadvisor
# ports:
# - 8080:8080
# volumes:
# - /:/rootfs:ro
# - /var/run:/var/run:rw
# - /sys:/sys:ro
# - /var/lib/docker/:/var/lib/docker:ro

cadvisor:
image: gcr.io/cadvisor/cadvisor:v0.45.0
container_name: cadvisor
privileged: true
devices:
- /dev/kmsg:/dev/kmsg
ports:
- 8080:8080
volumes:
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /etc/machine-id:/etc/machine-id:ro
- /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:ro
restart: unless-stopped
4 changes: 4 additions & 0 deletions prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ scrape_configs:
scrape_interval: 5s
static_configs:
- targets: ['app:5001']
- job_name: cadvisor
scrape_interval: 5s
static_configs:
- targets: ['cadvisor:8080']

0 comments on commit 7a2081b

Please sign in to comment.