Prometheus Querying Function rate() vs irate()
rate()
rate(v range-vector) calculates the per-second average rate of increase of the time series in the range vector.
rate()函数计算某个时间序列范围内的每秒平均增长率。
Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for.
自适应单调性中断(比如target重启导致的计数器重置)。
Also, the calculation extrapolates to the ends of the time range, allowing for missed scrapes or imperfect alignment of scrape cycles with the range's time period.
计算结果是推算到每个时间范围的最后而得出,允许漏抓和抓取周期与时间范围的不完美结合。
The following example expression returns the per-second rate of HTTP requests as measured over the last 5 minutes, per time series in the range vector:
以下示例返回最后五分钟HTTP请求每秒增长率
rate(http_requests_total{job="api-server"}[5m])
rate should only be used with counters. It is best suited for alerting, and for graphing of slow-moving counters.
rate应该只和计数器一起使用。最适合告警和缓慢计数器的绘图。
Note that when combining rate() with an aggregation operator (e.g. sum()) or a function aggregating over time (any function ending in _over_time), always take a rate() first, then aggregate. Otherwise rate() cannot detect counter resets when your target restarts.
irate()
irate(v range-vector) calculates the per-second instant rate of increase of the time series in the range vector.
irate()函数计算一段时间范围内某个时刻的每秒增长率
This is based on the last two data points. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for.
基于最后两个数据点进行计算。自适应单调性中断(比如target重启导致的计数器重置)。
The following example expression returns the per-second rate of HTTP requests looking up to 5 minutes back for the two most recent data points, per time series in the range vector:
以下示例返回五分钟内最近两次数据点的HTTP请求每秒增长率
irate(http_requests_total{job="api-server"}[5m])
irate should only be used when graphing volatile, fast-moving counters. Use rate for alerts and slow-moving counters,
rate应该只和快速的、不稳定的计数器一起使用。
as brief changes in the rate can reset the FOR clause and graphs consisting entirely of rare spikes are hard to read.
因为比率短暂的改变可以充值FOR语句,而且一个包含极少的峰(突然上升)的图是很难阅读的。
Note that when combining irate() with an aggregation operator (e.g. sum()) or a function aggregating over time (any function ending in _over_time), always take a irate() first, then aggregate.
Otherwise irate() cannot detect counter resets when your target restarts.
Prometheus Querying Function rate() vs irate()的更多相关文章
- Prometheus的监控解决方案(含监控kubernetes)
prometheus的简介和安装 Prometheus(普罗米修斯)是一个开源系统监控和警报工具,最初是在SoundCloud建立的.自2012年成立以来,许多公司和组织都采用了普罗米修斯,该项目拥有 ...
- prometheus杂碎
一个监控及告警的系统,内含一个TSDB(时序数据库).在我而言是一个数采程序 重要成员分三块 exploter:实际是外部接口,让各个程序实现这个接口,供普罗米修斯定时从此接口中取数 alert:告警 ...
- openresty(完整版)Lua拦截请求与响应信息日志收集及基于cjson和redis动态路径以及Prometheus监控(转)
直接上文件 nginx.conf #运行用户和组,缺省为nobody,若改为别的用户和组,则需要先创建用户和组 #user wls81 wls; #开启进程数,一般与CPU核数等同 worker_pr ...
- 【PromQL】prometheus查询语言
常用查询: https://songjiayang.gitbooks.io/prometheus/content/exporter/nodeexporter_query.html group by 操 ...
- 实战 Prometheus 搭建监控系统
实战 Prometheus 搭建监控系统 Prometheus 是一款基于时序数据库的开源监控告警系统,说起 Prometheus 则不得不提 SoundCloud,这是一个在线音乐分享的平台,类似于 ...
- Prometheus 后续杂记
在后续prometheus的使用中遇到的一些问题我会在此记录 搭建初期几个问题 rule.yml中对每条告警加上主机名? 要在告警通知中加上故障机器主机名不能从prometheus的采集监控项数据中的 ...
- Prometheus 与 Grafana 集成
简介 Grafana 是一个可视化仪表盘,它拥有美观的图标和布局展示,功能齐全的仪表盘和图形编辑器,默认支持 CloudWatch.Graphite.Elasticsearch.InfluxDB.My ...
- PromQL
PromQL (Prometheus Query Language) 是 Prometheus 自己开发的数据查询 DSL 语言,语言表现力非常丰富,内置函数很多,在日常数据可视化以及rule 告警中 ...
- YprogressBar,html5进度条样式,js进度条插件
简介 YprogressBar是一款基于HTML5的进度条插件. YprogressBar是一款轻量级进度条插件,使用方便,资源占用少,模仿好压的解压界面,带有数字显示,同时支持在描述中增加参数,以动 ...
随机推荐
- 使用IDEA搭建一个 Spring + Spring MVC + Mybatis 的Web项目 ( 零配置文件 )
前言: 除了mybatis 不是零配置,有些还是有xml的配置文件在里面的. 注解是Spring的一个构建的一个重要手段,减少写配置文件,下面解释一下一些要用到的注解: @Configuration ...
- MAC下安装Homebrew和GDB,并解决无法调试问题
Homebrew官网 http://brew.sh/index_zh-cn.html Homebrew是神马 linux系统有个让人蛋疼的通病,软件包依赖,好在当前主流的两大发行版本都自带了解决方案, ...
- 【C#-读取XML文件】XMLReader读取XML文档
使用 XmlReader.Create("文件路径") 加载xml文件 XmlReader使用流的方式来读取. //使用XMLReader读取XML数据 XmlReader ...
- node 的fs.state 获取文件信息
1. fs.stat()可以获取文件的信息,用法如下: const fs = require('fs'); fs.stat('./book.js',(err,stats)=>{ if(err) ...
- jquery设置css属性几种方式
用css()方法返回元素的样式属性 $("div").css("padding-left")); 用css()设置样式 $("div").c ...
- C语言 - 堆和栈
一.堆内存 1.就是程序员手动管理的一块内存,在C语言中,可以理解为用malloc.realloc等申请空间的一些函数,这些函数所申请的空间就是堆空间 2.C语言中,堆空间是申请和释放 malloc/ ...
- javascript中继承方式及优缺点(一)
分别介绍原型链继承.call/apply继承(借用构造函数继承).组合继承.原型式继承.寄生式继承.寄生组合式继承 1. 原型链继承 核心:将父类的实例作为子类的原型 function SuperTy ...
- Flyway Validate failed: Migration checksum mismatch for migration version 1.0.0.01 错误
在运行系统的时候出现错误: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ...
- [CSP-S模拟测试]:装饰(状压DP)
题目传送门(内部题114) 输入格式 第一行一个正整数$n$. 接下来一行$n-1$个正整数,第$i$个数为$f_{i+1}$. 接下来一行$n$个数,若第$i$个数为$0$则表示林先森希望$i$号点 ...
- i 是一个修饰符 (搜索不区分大小写)
什么是正则表达式? 正则表达式是由一个字符序列形成的搜索模式. 当你在文本中搜索数据时,你可以用搜索模式来描述你要查询的内容. 正则表达式可以是一个简单的字符,或一个更复杂的模式. 正则表达式可用于所 ...