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. Acwing-274-移动服务(DP)

    链接: https://www.acwing.com/problem/content/276/ 题意: 一个公司有三个移动服务员,最初分别在位置1,2,3处. 如果某个位置(用一个整数表示)有一个请求 ...

  2. Spring Boot 和 Spring Cloud Feign调用服务及传递参数踩坑记录(转)

    https://blog.csdn.net/uotail/article/details/84673347

  3. setAttribute()方法和 getAttribute() 方法

    一.setAttribute() 方法 setAttribute() 方法为一个或一组元素添加指定的属性,并且为其赋指定的值.(主要针对自定义属性) 如果这个属性已经存在,仅仅设置或是修改属性值. 浏 ...

  4. ubuntu1804 安装Nvidia驱动-nvidia-docker

    操作 看显卡 lspci | grep N 01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 960M] (rev a2) 0 ...

  5. k8s配置文件模板

    一,deployment Deployment为Pod和Replica Set下一代Replication Controller)提供声明式更新 1,配置示例 apiVersion: apps/v1 ...

  6. 定时任务spring task

    1)spring boot 几种定时任务的实现方式:https://www.jianshu.com/p/b6809b5a0c26 2)spring-boot 定时任务之Scheduled Task:h ...

  7. matplotlib中plt.scatter()参数详解

    scatter(x, y, s=None, c=None, marker=None, cmap=None, norm=None, vmin=None, vmax=None, alpha=None, l ...

  8. SPP框架的基本使用

    入职两天 Day1.Day2: 学习SPP框架 SPP是什么? SPP提供了一系列的基础功能,是一个通用的网络服务器运行框架.主要由proxy,worker,controller三个模块组成.它提供A ...

  9. 使用ElementUI创建项目

    从 0 开始搭建 element 项目 第一步,安装 Nodejs/NPM https://nodejs.org/zh-cn/download/ 下载安装即可! 第二步,安装 vue-cli 打开 c ...

  10. servlet3.0无web.xml

    大家应该都已经知道spring 3.1对无web.xml式基于代码配置的servlet3.0应用.通过spring的api或是网络上高手们的博文,也一定很快就学会并且加到自己的应用中去了.PS:如果还 ...