prometheus
  • Introduction
  • (一)快速开始
    • 安装Prometheus
    • 使用NodeExporter采集数据
    • AlertManager进行告警
    • Grafana数据可视化
  • (二)探索PromQL
    • 理解时间序列
    • Metrics类型
    • 初识PromQL
    • PromQL操作符
    • PromQL内置函数
    • PromQL聚合函数
  • (三)Prometheus告警处理
    • 自定义告警规则
    • 示例 - 对主机进行监控告警
    • 部署AlertManager
    • 告警的路由与分组
    • 使用Receiver接收告警信息
      • 集成邮件系统
    • 屏蔽告警通知
    • 扩展阅读
      • AlertManager的API
      • Prometheus发送告警机制
      • 实践:接收Prometheus的告警
      • 实践:AlertManager
  • Prometheus
    • PromQL
      • 内置函数
        • avg
        • rate与irate
      • 常见指标的PromQL
        • 主机CPU
    • 配置
      • 告警规则
Powered by GitBook
On this page
  • Counter:只增不减的计数器
  • Gauge:可增可减的仪表盘
  • to be continued

Was this helpful?

  1. (二)探索PromQL

Metrics类型

Prometheus定义了4中不同的指标类型(metric type):Counter(计数器)、Gauge(仪表盘)、Histogram(直方图)、Summary(摘要)。

在NodeExporter返回的样本数据中,其注释中也包含了该样本的类型。例如:

# HELP node_cpu_seconds_total Seconds the cpus spent in each mode.
# TYPE node_cpu_seconds_total counter
node_cpu_seconds_total{cpu="0",mode="idle"} 927490.95
node_cpu_seconds_total{cpu="0",mode="iowait"} 27.74
...

上面的就是counter类型的指标。

Counter:只增不减的计数器

Counter类型的指标数据,只增不减(除非系统发生重置)。常见的有node_cpu_seconds_total{cpu="x",mode="idle"},它表示的意思是序号为x的cpu从开机到当前的这段时间内,cpu处于空闲(idle)状态的时间总和。

Gauge:可增可减的仪表盘

Gauge类型的指标数据,可增可减,比如内存剩余量node_memory_MemAvailable

to be continued

Previous理解时间序列Next初识PromQL

Last updated 4 years ago

Was this helpful?