Prometheus metric

一、Metric获取方式

1、graph页面

http://普罗米修斯域名/graph

2、API接口

1)瞬时数据查询
2)区间数据查询

二、PromQL

1)基本语法
2)操作符
3)内置函数

三、常用度量指标

类型 指标 含义
CPU container_cpu_cfs_periods_total 容器生命周期中度过的 cpu 周期总数
CPU container_cpu_cfs_throttled_periods_total 容器生命周期中度过的受限的 cpu 周期总数
CPU container_cpu_cfs_throttled_seconds_total 容器生命周期中受限的总时间(秒)
CPU container_cpu_load_average_10s 过去10秒内的CPU负载的平均值
CPU container_cpu_usage_seconds_total 容器累计使用CPU的时间 (秒)
CPU container_cpu_system_seconds_total 容器System CPU累积占用时间(秒)
CPU container_cpu_user_seconds_total 容器User CPU累积占用时间(秒)
CPU container_spec_cpu_quota 对应kubernetes的resource.cpu.limits的值
CPU container_spec_cpu_shares 对应kubernetes的resource.cpu.requests的值
MEM container_memory_usage_bytes 容器当前的内存使用量,包括所有内存(字节)
MEM container_memory_max_usage_bytes 容器最大内存使用量的记录,包括所有内存(字节)
MEM container_memory_cache 高速缓存使用量(字节)
MEM container_memory_swap 虚拟内存使用量(字节)
MEM container_memory_rss 常驻内存集,包括所有分配的栈内存和堆内存,以及加载到物理内存中的共享库占用的内存空间,但不包括进入交换分区的内存
MEM container_memory_working_set_bytes 当前内存工作集(working set)使用量(决定oom)
MEM container_oom_events_total oom次数
MEM container_memory_failcnt 申请内存失败次数计数
MEM container_memory_failures_total 累计的内存申请错误次数
MEM container_spec_memory_limit_bytes 容器的内存使用量限制,包括所有内存,对应k8s的limit
MEM container_spec_memory_reservation_limit_bytes 物理内存限制
MEM container_spec_memory_swap_limit_bytes 虚拟内存限制
Disk container_fs_limit_bytes 容器可以使用的文件系统总量(字节)
Disk container_fs_usage_bytes 容器中文件系统的使用量(字节)
DISK IO container_fs_reads_bytes_total 读取的累计字节数
DISK IO container_fs_writes_bytes_total 写入的累计字节数
DISK IO container_fs_io_time_seconds_total 执行I/O所花费的时间(秒)
NET IO container_network_receive_bytes_total 容器网络累积接收数据总量(单位:字节)
NET IO container_network_receive_errors_total 接收时遇到的累计错误数
NET IO container_network_transmit_bytes_total 容器网络累积传输数据总量(单位:字节)
NET IO container_network_transmit_errors_total 传输时遇到的累计错误数

指标详见 https://github.com/google/cadvisor/blob/master/docs/storage/prometheus.md

猜你喜欢

转载自blog.csdn.net/qq_21033663/article/details/123305812