knowledge/technology/applications/utilities/cAdvisor.md

43 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2024-12-12 09:48:42 +01:00
---
obj: application
repo: https://github.com/google/cadvisor
rev: 2024-12-12
---
# cAdvisor
cAdvisor (Container Advisor) provides container users an understanding of the resource usage and performance characteristics of their running containers. It is a running daemon that collects, aggregates, processes, and exports information about running containers. Specifically, for each container it keeps resource isolation parameters, historical resource usage, histograms of complete historical resource usage and network statistics. This data is exported by container and machine-wide.
## Prometheus
Add this to [Prometheus](../web/Prometheus.md) config file:
```yml
scrape_configs:
- job_name: cadvisor
scrape_interval: 5s
static_configs:
- targets:
- cadvisor:8080
```
## Docker-Compose
```yml
services:
cadvisor:
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
ports:
- target: 8080
published: 8080
protocol: tcp
mode: host
privileged: true
image: gcr.io/cadvisor/cadvisor
deploy:
mode: global
```