 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 年前3 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 年前3
 Intro to Prometheus - With a dash of operations & observability@fredbrancz Intro to Prometheus Introduction Background Operations & observability Outro PromQL vs SQL avg by(city) (temperature_celsius{country=" germany" }) SELECT city, AVG(value) FROM temperature_celsius0 码力 | 19 页 | 63.73 KB | 1 年前3 Intro to Prometheus - With a dash of operations & observability@fredbrancz Intro to Prometheus Introduction Background Operations & observability Outro PromQL vs SQL avg by(city) (temperature_celsius{country=" germany" }) SELECT city, AVG(value) FROM temperature_celsius0 码力 | 19 页 | 63.73 KB | 1 年前3
 Prometheus 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 年前3 Prometheus 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 年前3
共 3 条
- 1













