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()的更多相关文章

  1. Prometheus的监控解决方案(含监控kubernetes)

    prometheus的简介和安装 Prometheus(普罗米修斯)是一个开源系统监控和警报工具,最初是在SoundCloud建立的.自2012年成立以来,许多公司和组织都采用了普罗米修斯,该项目拥有 ...

  2. prometheus杂碎

    一个监控及告警的系统,内含一个TSDB(时序数据库).在我而言是一个数采程序 重要成员分三块 exploter:实际是外部接口,让各个程序实现这个接口,供普罗米修斯定时从此接口中取数 alert:告警 ...

  3. openresty(完整版)Lua拦截请求与响应信息日志收集及基于cjson和redis动态路径以及Prometheus监控(转)

    直接上文件 nginx.conf #运行用户和组,缺省为nobody,若改为别的用户和组,则需要先创建用户和组 #user wls81 wls; #开启进程数,一般与CPU核数等同 worker_pr ...

  4. 【PromQL】prometheus查询语言

    常用查询: https://songjiayang.gitbooks.io/prometheus/content/exporter/nodeexporter_query.html group by 操 ...

  5. 实战 Prometheus 搭建监控系统

    实战 Prometheus 搭建监控系统 Prometheus 是一款基于时序数据库的开源监控告警系统,说起 Prometheus 则不得不提 SoundCloud,这是一个在线音乐分享的平台,类似于 ...

  6. Prometheus 后续杂记

    在后续prometheus的使用中遇到的一些问题我会在此记录 搭建初期几个问题 rule.yml中对每条告警加上主机名? 要在告警通知中加上故障机器主机名不能从prometheus的采集监控项数据中的 ...

  7. Prometheus 与 Grafana 集成

    简介 Grafana 是一个可视化仪表盘,它拥有美观的图标和布局展示,功能齐全的仪表盘和图形编辑器,默认支持 CloudWatch.Graphite.Elasticsearch.InfluxDB.My ...

  8. PromQL

    PromQL (Prometheus Query Language) 是 Prometheus 自己开发的数据查询 DSL 语言,语言表现力非常丰富,内置函数很多,在日常数据可视化以及rule 告警中 ...

  9. YprogressBar,html5进度条样式,js进度条插件

    简介 YprogressBar是一款基于HTML5的进度条插件. YprogressBar是一款轻量级进度条插件,使用方便,资源占用少,模仿好压的解压界面,带有数字显示,同时支持在描述中增加参数,以动 ...

随机推荐

  1. iview 在Table组件中使用switch组件并自定义内容和增加自定义事件

    注意: 使用render函数. 效果: 添加自定义文字: 1. 2. 上面的两种方法效果都是一样的: 增加自定义事件: 结果: 自信是进步的源泉. 继续加油. ^_^

  2. GitLab项目管理实践

    群组 / 项目 群组和项目的关系我们可以简单的理解成文件夹和文件的关系.一个群组可以包含一个或多个项目. 使用群组,可以将相关的项目组合在一起,并允许成员同时访问多个项目. 群组也可以嵌套在子组中,建 ...

  3. GridView设置右键菜单

    一.控件设定: 1.页面添加ContextMenuStrip控件: 2.ContextMenuStrip添加菜单项: 3.gridControl找到ContextMenuStrip属性,设置成刚添加C ...

  4. static后期静态绑定

    先说一下__CLASS__,get_class() ,  get_called_class() 区别: __CLASS__获取当前的类名, get_class()与上面一样,都是获取当前的类名, ge ...

  5. java文件上传下载解决方案

    javaweb上传文件 上传文件的jsp中的部分 上传文件同样可以使用form表单向后端发请求,也可以使用 ajax向后端发请求 1.通过form表单向后端发送请求 <form id=" ...

  6. vue中的js绑定样式

    添加class 对象形式添加   activated为true时p标签的class为activated false时为空 <div id="app"> <p :c ...

  7. HTML jQuery 文档操作 - html() 方法

    jQuery 文档操作 - html() 方法 jQuery 文档操作参考手册 实例 设置所有 p 元素的内容: $(".btn1").click(function(){ $(&q ...

  8. 【转】如何在Oracle中复制表结构和表数据

    特别提示:本人博客部分有参考网络其他博客,但均是本人亲手编写过并验证通过.如发现博客有错误,请及时提出以免误导其他人,谢谢!欢迎转载,但记得标明文章出处:http://www.cnblogs.com/ ...

  9. linux各种中文乱码解决办法整理

    2016年03月21日 15:52:05 阅读数:30812 远程登录服务器用vim在终端下编辑查看文件经常会遇见各种中文乱码问题.做如下设置可基本解决vim中文乱码问题 首先查看系统对中文的支持lo ...

  10. leetcode 452用少量的箭射爆气球

    类似于区间调度问题,使用贪心算法:首先对所有气球按照起始坐标大小排序,然后每次总是优先选择起始坐标小的气球中的右边坐标,然后再选择下一个: 排完序之后,下一个可能有如上图所示几种情况, 1)   当n ...