mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-10-20 17:56:30 +00:00
fix(content): refresh Docker and Kubernetes guidance
This commit is contained in:
@@ -160,10 +160,10 @@ $ docker compose up -d
|
||||
* **节点 CPU 使用率**:`100 - (avg by (instance) (rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100)`
|
||||
* **节点内存使用率**:`(1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)) * 100`
|
||||
* **节点磁盘空间使用率**:`(1 - (node_filesystem_avail_bytes{fstype!~"tmpfs|overlay"} / node_filesystem_size_bytes{fstype!~"tmpfs|overlay"})) * 100`
|
||||
* **容器 CPU**:`sum by (name) (rate(container_cpu_usage_seconds_total[5m]))`
|
||||
* **容器内存**:`sum by (name) (container_memory_working_set_bytes)`
|
||||
* **容器 CPU**:`sum by (namespace, pod, container) (rate(container_cpu_usage_seconds_total[5m]))`
|
||||
* **容器内存**:`sum by (namespace, pod, container) (container_memory_working_set_bytes)`
|
||||
|
||||
说明:不同版本的 cAdvisor/Docker 对 label 命名可能存在差异 (如 `name`、`container`、`container_name`),如果查询为空,建议先用 `label_values(container_cpu_usage_seconds_total, __name__)` 或在 Prometheus 的图形界面查看可用 label。
|
||||
说明:不同采集路径的 label 命名不同。Docker Compose 中独立部署的 cAdvisor 常见容器标签是 `name`;Kubernetes kubelet 的 `/metrics/cadvisor` 中,`container_cpu_usage_seconds_total` 等稳定指标使用 `container`、`pod`、`namespace`。如果查询为空,先直接查询 `container_cpu_usage_seconds_total` 样本并在 Prometheus 图形界面查看实际 label,不要假设存在 `container_name`。
|
||||
|
||||
#### Targets down 排错清单
|
||||
|
||||
|
||||
Reference in New Issue
Block a user