title, type, aliases, tags, date
| title |
type |
aliases |
tags |
date |
| cAdvisor |
entity |
| cAdvisor |
| Container Advisor |
| Google cAdvisor |
|
| monitoring |
| container |
| docker |
| prometheus |
| kubernetes |
|
2025-11-11 |
cAdvisor
Overview
cAdvisor(Container Advisor)是 Google 开源的容器资源监控工具,专门为 Docker 容器提供资源使用和性能指标的采集。它能自动发现机器上运行的所有容器,收集包括 CPU、内存、网络、磁盘 I/O 在内的各项资源指标,并暴露 Prometheus 格式的 /metrics 端点。
Key Characteristics
- 自动发现:自动发现并监控机器上所有 Docker 容器,无需手动配置
- 容器层级指标:单容器粒度的资源使用数据
- 历史数据:支持容器级别的资源历史趋势
- Docker Socket 依赖:需要挂载
/var/run/docker.sock 访问容器运行时信息
Key Metrics Collected
| 分类 |
指标前缀 |
说明 |
| CPU |
container_cpu_usage_seconds_total |
容器 CPU 使用时间 |
| 内存 |
container_memory_usage_bytes |
容器内存使用量 |
| 网络 |
container_network_receive_bytes_total |
网络接收字节 |
| 磁盘 |
container_fs_reads_bytes_total |
磁盘读取字节 |
| 进程 |
container_tasks |
容器内任务/进程数 |
| 重启 |
container_restart_count |
容器重启次数 |
| 资源限制 |
container_spec_memory_limit_bytes |
内存限制值 |
Home Server Deployment
⚠️ 安全注意:挂载 Docker socket(/var/run/docker.sock)授予容器等同于宿主机 root 的权限。审慎评估风险,仅在内网可信环境中使用。
Prometheus scrape_config
Related Sources
Related Entities
Related Concepts