prometheus 表达式
avg_over_time(my_inprogress_requests{job="mhc"}[5m] offset 3m)
返回time=1550664637开始向前偏移3分钟之前的五分钟的平均值
curl -X GET \
'http://mhc-linux:9090/api/v1/query?query=avg_over_time%28my_inprogress_requests{job=%22mhc%22}[5m]%20%20offset%203m%29&time=1550664637' \
-H 'Postman-Token: eeede4b6-e57b-42b1-92e1-d2dec4558f0e' \
-H 'cache-control: no-cache'
{
"status": "success",
"data": {
"resultType": "vector",
"result": [
{
"metric": {
"instance": "192.168.121.58:8000",
"job": "mhc"
},
"value": [
1550664637,
"425.1333333333333"
]
}
]
}
}
curl -X GET \
'http://mhc-linux:9090/api/v1/query_range?query=avg_over_time%28my_inprogress_requests{job=%22mhc%22}[5m]%20%20offset%2010m%29&start=1550664637&end=1550664937&step=60' \
-H 'Postman-Token: b274b534-eede-4d4b-b85c-2f0ad8dbd44e' \
-H 'cache-control: no-cache'
{
"status": "success",
"data": {
"resultType": "matrix",
"result": [
{
"metric": {
"instance": "192.168.121.58:8000",
"job": "mhc"
},
"values": [
[
1550664637,
"474.0666666666666"
],
[
1550664697,
"511.11666666666673"
],
[
1550664757,
"468.6666666666667"
],
[
1550664817,
"464.03333333333313"
],
[
1550664877,
"494.83333333333326"
],
[
1550664937,
"491.38333333333327"
]
]
}
]
}
}
sum(avg_over_time(my_inprogress_requests{user="mhc"}[1m]))
prometheus 表达式的更多相关文章
- Prometheus监控学习笔记之初识PromQL
0x00 概述 Prometheus 提供了一种功能表达式语言 PromQL,允许用户实时选择和汇聚时间序列数据.表达式的结果可以在浏览器中显示为图形,也可以显示为表格数据,或者由外部系统通过 HTT ...
- 微服务监控之三:Prometheus + Grafana Spring Boot 应用可视化监控
一.Springboot增加Prometheus 1.Spring Boot 应用暴露监控指标,添加如下依赖 <dependency> <groupId>org.springf ...
- Prometheus 与 Grafana 集成
简介 Grafana 是一个可视化仪表盘,它拥有美观的图标和布局展示,功能齐全的仪表盘和图形编辑器,默认支持 CloudWatch.Graphite.Elasticsearch.InfluxDB.My ...
- Prometheus学习系列(八)之Prometheus API说明
前言 本文来自Prometheus官网手册 和 Prometheus简介 HTTP API 在Prometheus服务器上的/api/v1下可以访问当前稳定的HTTP API. 将在该端点下添加任何非 ...
- Prometheus学习系列(六)之Prometheus 查询说明
前言 本文来自Prometheus官网手册和 Prometheus简介 Prothetheus查询 Prometheus提供一个函数式的表达式语言PromQL (Prometheus Query La ...
- Prometheus学习系列(五)之Prometheus 规则(rule)、模板配置说明
前言 本文来自Prometheus官网手册1.2.3.4和 Prometheus简介1.2.3.4 记录规则 一.配置规则 Prometheus支持两种类型的规则,这些规则可以定期配置,然后定期评估: ...
- Prometheus学习系列(二)之Prometheus FIRST STEPS
前言 本文来自Prometheus官网手册 和 Prometheus简介 说明 Prometheus是一个监控平台,通过在监控目标上的HTTP端点来收集受监控目标的指标.本指南将向您展示如何使用Pro ...
- Prometheus Grafana快速搭建
Prometheus Prometheus和Grafana组合基本上是监控系统的标配.Prometheus做存储后端,Grafana做分析及可视化界面. 普罗米修斯是开源的系统监控/报警工具库,功能非 ...
- Prometheus之Exporter开发
Prometheus开发Exporter简介 Exporter 本身是一个http 服务,其指标结果只要符合 Prometheus 规范就可以被 Prometheus 使用. Prometheus中m ...
随机推荐
- python:递归函数(汉诺塔)
#hanoi.py def hanoi(n,x,y,z): if n==1: print(x,"-->",z) else: hanoi(n-1,x,z,y) print(x, ...
- Python3 Flask+nginx+Gunicorn部署(上)
前言:一般在本地运行flask项目通常是直接python3 文件名.py,然后打开:http://127.0.0.1:5000 查看代码结果 这次主要是记录flask在python3 环境结合ngin ...
- xen虚拟化平台虚拟机在线新加一块磁盘无法识别
截图 报错:you need to shutdown and then restart the vm before it can access the new disk 添加好磁盘后按照提示重启虚拟机 ...
- Python的深copy和浅copy
浅拷贝(copy):拷贝父对象,不会拷贝对象的内部的子对象. 深拷贝(deepcopy): copy 模块的 deepcopy 方法,完全拷贝了父对象及其子对象. 浅copy: a = [1, 2, ...
- oracle impdp导入脚本
第一步:sqlplus: sys下面 create directory data_dir as '/home/oracle/dmp/user'; 第二步:sqlplus: sys下面grant rea ...
- 如何在myeclipse中安装spket插件
在web开发中,经常会遇到自动提示,比如jquery.extjs等,在myeclipse写这些代码时需要自动提示,就需要安装spket插件,具体方法见下面 工具/原料 myeclipse spke ...
- AR外包,就找北京动点软件,长年承接AR外包(案例丰富可签合同,内附案例演示)
北京团队长年承接AR项目外包 咨询QQ:372900288 微信:liuxiang0884 以下是AR项目案例演示,索取更多案例请通过以上方式在线联系我们
- PCB行业研究
PCB行业研究 PCB产业上下游 关于HDI电路板 主要用于手机行业,对电路板面积有严格要求. 啥时候铜材料上涨
- xtrabackup的执行过程
XtraBackup的执行过程 执行全量备份过程中对数据库进行的操作https://www.cnblogs.com/digdeep/p/4946230.html 可以看出执行xtrabackup进行全 ...
- Android jni中回调java的方法
在上一篇的基础上,添加在C++代码中回调java方法. 代码如下: Demo.java 中添加callback函数, 打印一条log. package com.example.scarecrow.dy ...