PromQL 从入门到精通
不动上报给监控服务端,那计算增量、计算速率这个需求,就要放到服务端来实现了,所以服务 端必须要能对这种类型的数据建模抽象,也就是所谓的 Counter 类型。 时序数据 PromQL 就是查询时序数据的一种 Query Language,要想对 PromQL 有了解,得先搞清楚时 序数据。 认识时序数据 我们先来看一张图,图上是 5 台机器的内存可用率: 每个机器的内存可用率数据,体现为图上的一条线,我们称为 但是,监控数据是周期性上报的,比如每 10 秒上报一次,在 2022-08-25 15:48:03 这个时 刻,未必恰好有监控数据啊,那这个 Table 中的数据是哪里来的? 实际上,Prometheus 有个启动参数,--query.lookback-delta=2m 来控制这个行为,如果配 置为 2m,就表示,Prometheus 会查询 2022-08-25 15:46:03 ~ 2022-08-25 15:48:03 串)。返回瞬时向量的查询表达式,我们 称为 Instant Query,返回范围向量的查询表达式,我们称为 Range Query。 上例中的 mem_available_percent{app="clickhouse"} 既可以用于展示 Table 视图,又可以用 于展示 Graph 视图,是典型的 Instant Query。 如果在表达式后面加上一个时间范围,比如 1 分钟: me0 码力 | 16 页 | 2.77 MB | 1 年前3Prometheus Deep Dive - Monitoring. At scale.
reduction in CPU usage 80-100x reduction in disk writes 5x reduction in on-disk size 4x reduction in query latency on expensive queries Want to reproduce? https://github.com/prometheus/prombench Richard timestamp Any append action which has not yet been committed, or has been rolled back, is ignored at query time We keep write IDs in memory; if we restart or crash, the atomicity of the write ahead log will0 码力 | 34 页 | 370.20 KB | 1 年前3B站统⼀监控系统的设计,演进 与实践分享
prometheus prometheus filter数据 精度降低 建议 降低使⽤用成本 agent prometheus target target target alert_manager 告警平 服务 cache db平台 rms资 外围系统 监控⽬目 规则⽣生 告警规 api 规则管理理 获取监控⽬目标 IDC_1 agent prometheus push rule push rule 获取监控数据 获取监控数据 推送告警 降低使⽤用成本 agent prometheus target target target alert_manager 告警平 服务 cache db平台 rms资 外围系统 监控⽬目 规则⽣生 告警规 api 规则管理理 获取监控⽬目标 IDC_1 agent prometheus rule 获取监控数据 获取监控数据 推送告警 1. 降低编写规则的成本 降低使⽤用成本 agent prometheus target target target alert_manager 告警平 服务 cache db平台 rms资 外围系统 监控⽬目 规则⽣生 告警规 api 规则管理理 获取监控⽬目标 IDC_1 agent prometheus0 码力 | 34 页 | 650.25 KB | 1 年前3
共 3 条
- 1