PromQL 从入门到精通Language,要想对 PromQL 有了解,得先搞清楚时 序数据。 认识时序数据 我们先来看一张图,图上是 5 台机器的内存可用率: 每个机器的内存可用率数据,体现为图上的一条线,我们称为 series,某个机器在某一时刻的内 存可用率数据,我们称为数据点,比如上图,2022-08-25 15:05:22 这个时刻,每个机器都有 一个可用率数据点,共计 5 个数据点。 上面的图是查询的最近一小时的,我们切换到 的(当然有些时序库可能会做容错处理),因为从原 理上说不通。绘图的时候,我们要选择一个时间范围,比如最近一小时,然后传给后端一个 step 参数用于控制分辨率,即数据间隔,比如 step=60,即表示希望每个 series 每分钟返回一 个点,但如果是 Range Query,相当于在某个时刻返回多个点,这就无所适从了。 Prometheus 文档中有一个章节专门介绍函数,各个函数的介绍中,都会写明是用于 instant- 标签做匹配,忽略其他标签。 与on相反的是ignoring关键字,顾名思义,ignoring是忽略掉某些标签,用剩下的标签来做匹 配。我们拿 Prometheus 文档中的例子来说明: ## example series method_code:http_errors:rate5m{method="get", code="500"} 24 method_code:http_errors:rate5m{method="get"0 码力 | 16 页 | 2.77 MB | 1 年前3
Prometheus Deep Dive - Monitoring. At scale.Introduction Intro 2.0 to 2.2.1 2.4 - 2.6 Beyond Outro Prometheus 101 Inspired by Google’s Borgmon Time series database int64 timestamp, float64 value Ecosystem of instrumentation & exporters Not for events - 2.6 Beyond Outro Storage Prometheus 1.x We used to have one file per time series ..and one common index for all of time Relatively easy to implement Pretty efficient Why change? Richard Hartmann maximum lifetime for their containers If you have a lot of files which might contain data for any given time frame, you need to look at all of them Richard Hartmann & Frederic Branczyk @TwitchiH & @fredbrancz0 码力 | 34 页 | 370.20 KB | 1 年前3
Intro to Prometheus - With a dash of operations & observability@TwitchiH & @fredbrancz Intro to Prometheus Introduction Background Operations & observability Outro Time split 1 1/3 Prometheus 2 1/3 Observability 3 1/3 Questions Richard Hartmann & Frederic Branczyk Introduction Background Operations & observability Outro Prometheus 101 Inspired by Google’s Borgmon Time series database unit64 millisecond timestamp, float64 value Instrumentation & exporters Not for event server answer to HTTP requests?) White-box monitoring: Instrumention code from the inside (How much time does this subroutine take?) Every service should have its own metrics endpoint Hard API commitments0 码力 | 19 页 | 63.73 KB | 1 年前3
OpenMetrics - Standing on the shoulders of Titansimplementation Still finding minor bugs during implementation RFC currently blocked on me finding time Prometheus: experimental support since 2.5.0 Python client library: experimental support since 0 Plans Beyond metrics OpenMetrics supports more than just metrics Every single data point in a time series can point to one single event Especially useful if you emit one trace id per histogram bucket0 码力 | 21 页 | 84.83 KB | 1 年前3
共 4 条
- 1













