PromQL 从入门到精通PromQL 从⼊⻔到精通 对于 Prometheus 生态的监控系统,PromQL 是必备技能,本文着重点讲解这个查询语言,掺 杂一些生产实践场景,希望对你有所帮助。 ? 本文作者:秦晓辉,Open-Falcon、Nightingale 等开源项目创始人之一,极客时间《运 维监控系统实战笔记》作者;当前在创业(快猫星云联创),为客户提供监控/可观测性产品 方案,有需求的朋友欢迎联系我的微信 不动上报给监控服务端,那计算增量、计算速率这个需求,就要放到服务端来实现了,所以服务 端必须要能对这种类型的数据建模抽象,也就是所谓的 Counter 类型。 时序数据 PromQL 就是查询时序数据的一种 Query Language,要想对 PromQL 有了解,得先搞清楚时 序数据。 认识时序数据 我们先来看一张图,图上是 5 台机器的内存可用率: 每个机器的内存可用率数据,体现为图上的一条线,我们称为 文档中有一个章节专门介绍函数,各个函数的介绍中,都会写明是用于 instant- vector,还是用于 range-vector,如果不理解查询类型,就无法很好的应用这些函数。 查询选择器 PromQL大括号里的部分是 selector,查询选择器,用于从一大堆监控数据中,过滤出真正关心 的数据,在 Prometheus 生态里,时序数据的标识,就是一堆标签集合,所以这里的过滤,就 是针对标签做过滤,支持四类操作符:0 码力 | 16 页 | 2.77 MB | 1 年前3
Prometheus Deep Dive - Monitoring. At scale.points Highly dynamic, built-in service discovery No hierarchical model, n-dimensional label set PromQL: for processing, graphing, alerting, and export Simple operation Highly efficient Richard Hartmann Prometheus Deep Dive Introduction Intro 2.0 to 2.2.1 2.4 - 2.6 Beyond Outro PromQL Quick is not quick enough Brian Brazil optimized PromQL 5x faster for time vector functions 100x reduction in garbage to collect0 码力 | 34 页 | 370.20 KB | 1 年前3
Intro to Prometheus - With a dash of operations & observabilitypoints Highly dynamic, built-in service discovery No hierarchical model, n-dimensional label set PromQL: for processing, graphing, alerting, and export Simple operation Highly efficient Richard Hartmann @TwitchiH & @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
共 3 条
- 1













