美文网首页
常用promQL语句

常用promQL语句

作者: Rami | 来源:发表于2022-11-27 21:22 被阅读0次

cAdvisor中获取常用指标说明

指标名称 类型 含义
container_cpu_load_average_10s gauge 过去10秒容器CPU的平均负载
container_cpu_usage_seconds_total counter 容器在每个CPU内核上的累积占用时间 (单位:秒)
container_cpu_system_seconds_total counter System CPU累积占用时间(单位:秒)
container_cpu_user_seconds_total counter User CPU累积占用时间(单位:秒)
container_fs_usage_bytes gauge 容器中文件系统的使用量(单位:字节)
container_fs_limit_bytes gauge 容器可以使用的文件系统总量(单位:字节)
container_fs_reads_bytes_total counter 容器累积读取数据的总量(单位:字节)
container_fs_writes_bytes_total counter 容器累积写入数据的总量(单位:字节)
container_memory_max_usage_bytes gauge 容器的最大内存使用量(单位:字节)
container_memory_usage_bytes gauge 容器当前的内存使用量(单位:字节
container_spec_memory_limit_bytes gauge 容器的内存使用量限制
machine_memory_bytes gauge 当前主机的内存总量
container_network_receive_bytes_total counter 容器网络累积接收数据总量(单位:字节)
container_network_transmit_bytes_total counter 容器网络累积传输数据总量(单位:字节)

容器相关

查询所有pod的1min内CPU使用情况

sum by (pod) ( rate(container_cpu_usage_seconds_total{image!="",pod!=""}[1m]))

内存的总占用量

container_memory_usage_bytes

容器网络接收的字节数(1分钟内),根据名称查询 name=~".+"

sum(rate(container_network_receive_bytes_total{name=~".+"}[1m])) by (name)

容器网络传输的字节数(1分钟内),根据名称查询 name=~".+"

sum(rate(container_network_transmit_bytes_total{name=~".+"}[1m])) by (name)

查询容器网络接收量(速率)(单位:字节/秒)

sum(rate(container_network_receive_bytes_total{image!=""}[1m])) without (interface)

容器网络传输量 字节/秒

sum(rate(container_network_transmit_bytes_total{image!=""}[1m])) without (interface)

查询容器内存使用量(单位:字节)

container_memory_usage_bytes{image!=""}

所有容器system cpu的累计使用时间(1min钟内)

sum(rate(container_cpu_system_seconds_total[1m]))

每个容器system cpu的使用时间(1min钟内)

sum(irate(container_cpu_system_seconds_total{image!=""}[1m])) without (cpu)

每个容器的cpu使用率

sum(rate(container_cpu_usage_seconds_total{name=~".+"}[1m])) by (name) * 100

总容器的cpu使用率

sum(sum(rate(container_cpu_usage_seconds_total{name=~".+"}[1m])) by (name) * 100)

Node-exporter 获取常用指标说明

指标名称 类型 含义
node_boot_time gauge 启动时间相关
node_cpu_seconds_total counter 系统CPU使用量
node_disk_io_now gauge 磁盘IO相关
node_disk_read_bytes_total counter 磁盘读
node_disk_written_bytes_total counter 磁盘写指标
node_filesystem_files gauge 文件系统用量
node_load1/node_load5/node_load15 gauge 系统1分钟、5分钟、15分钟负载
node_memory_MemTotal_bytes gauge 内存使用量
node_memory_SwapTotal_bytes gauge Swap使用量
node_network* counter 网络带宽相关
node_time_* counter 当前系统时间
go_*: counter/gauge node exporter中go相关指标
process_* counter/gauge node exporter自身进程相关运行指标

Node相关

Node 节点IO性能

100-(avg(irate(node_disk_io_time_seconds_total[1m])) by(instance)* 100)

Node 节点 TCP 会话处于established状态

node_netstat_Tcp_CurrEstab 

相关文章

  • 分布式 Promethues 之 Thanos

    其实接触Promethues时间也不长,开始觉得吧这个啥东西啊,PromQL语句简直逆天「有一定学习成本」,用着发...

  • 五分钟了解LogQL

    受PromQL的启发,Loki也有自己的LogQL查询语句。根据官方的说法,它就像一个分布式的grep日志聚合查看...

  • PromQL

    基本信息 http_requests_total{job="prometheus",group="canary"}...

  • promQL

    一,简单运算 1,查看三台机器的总内存 三台机器为master,和2台node节点,总内存为3G 2,查看可用内存...

  • PromQL

    PromQL的四种数据类型 瞬时向量(Instant vector):一组时间序列,每个时间序列包含单个样本,它们...

  • MySQL常用语句

    MySQL常用语句 tags: MySQL 常用语句 语法 随便写的标签 建表 insert 语句 msyql 把...

  • ECMAScript 语句

    一、ECMAScript if 语句 if 语句是 ECMAScript 中最常用的语句之一。 if 语句的语法:...

  • BigData-MySQL总结大全(一)苏暖人

    BigData之MySQL总结大全 MYSQL常用的基本语句 MYSQL常用的基本语句 例:SELECT TOP ...

  • Prometheus 查询语言

    [TOC] Prometheus 查询语言 PromQL(Prometheus Query Language)是 ...

  • Shell结构化命令(1):控制流

    使用if - then - else语句 if - then - else语句类似我们常用的if - else,基...

网友评论

      本文标题:常用promQL语句

      本文链接:https://www.haomeiwen.com/subject/tsskfdtx.html