当前位置:网站首页>Prometheus 运维工具 Promtool (二) Query 功能
Prometheus 运维工具 Promtool (二) Query 功能
2022-07-25 23:55:00 【InfoQ】
实时查询
promtool query instant [<flags>] <server> <expr>
[[email protected] ~]# ./promtool query instant 'http://127.0.0.1:9090' 'up == 1'
up{instance="172.16.6.97:9100", job="mysql_Host"} => 1 @[1658760087.156]
up{instance="172.16.6.98:9100", job="mysql_Host"} => 1 @[1658760087.156]
up{instance="172.16.6.98:9104", job="mysql_DB", nodename="Erdong-DB"} => 1 @[1658760087.156]
up{instance="172.16.6.76:7002", job="kong"} => 1 @[1658760087.156]
up == 1范围查询
promtool query range [<flags>] <server> <expr>
[[email protected] ~]# ./promtool query range --start=$(date -d '5minutes ago' +'%s') --end=$(date -d 'now' +'%s') --step=1m 'http://127.0.0.1:9090' 'up == 1'
up{instance="172.16.6.97:9100", job="mysql_Host"} =>
1 @[1658760631]
1 @[1658760691]
1 @[1658760751]
1 @[1658760811]
1 @[1658760871]
1 @[1658760931]
up{instance="172.16.6.98:9100", job="mysql_Host"} =>
1 @[1658760631]
1 @[1658760691]
1 @[1658760751]
1 @[1658760811]
1 @[1658760871]
1 @[1658760931]
up{instance="172.16.8.76:7002", job="kong"} =>
1 @[1658760631]
1 @[1658760691]
1 @[1658760751]
1 @[1658760811]
1 @[1658760871]
1 @[1658760931]
up{instance="172.16.6.98:9104", job="mysql_DB", nodename="Erdong-DB"} =>
1 @[1658760631]
1 @[1658760691]
1 @[1658760751]
1 @[1658760811]
1 @[1658760871]
1 @[1658760931]
up == 1序列查询
promtool query series --match=MATCH [<flags>] <server>
[[email protected] ~]# ./promtool query series 'http://127.0.0.1:9090' --match='up' --match='go_info{job="prometheus"}'
{__name__="go_info", instance="172.16.6.97:9100", job="mysql_Host", version="go1.16.7"}
{__name__="go_info", instance="172.16.6.98:9100", job="mysql_Host", version="go1.16.7"}
{__name__="go_info", instance="172.16.6.99:9100", job="mysql_Host", version="go1.17.3"}
{__name__="up", instance="172.16.6.97:9100", job="mysql_Host"}
{__name__="up", instance="172.16.6.98:9100", job="mysql_Host"}
{__name__="up", instance="172.16.6.99:9100", job="mysql_Host"}
{__name__="up", instance="172.16.6.97:9104", job="mysql_DB", nodename="Erdong-DB"}
{__name__="up", instance="172.16.8.76:7002", job="kong"}
label 查询
promtool query labels [<flags>] <server> <name>
[[email protected] ~]# ./promtool query labels 'http://127.0.0.1:9090' 'instance'
172.16.6.97:9100
172.16.6.97:9104
172.16.6.98:9100
172.16.6.99:9100
172.16.8.76:7002
边栏推荐
- [day.2] Joseph Ring problem, how to use arrays to replace circular linked lists (detailed explanation)
- 赋值时'1和'b1有什么区别
- 多御安全浏览器手机版将增加新功能,使用户浏览更个性化
- Nacos offline service times error errcode: 500
- 程序员面试金典 4.12 求和路径
- 意向不到的Dubug妙招
- Static agent + dynamic agent
- MySQL的DDL、DML和DQL的基本语法
- Imitating the magnifying glass effect of JD products -- JS Foundation
- Qpprogressbar for QT style (QSS) application
猜你喜欢

Numerical learning iota, accumulate

Redis basic data type (string/list/set/hash/zset)

TOPSIS and entropy weight method

老旧笔记本电脑变服务器(笔记本电脑+内网穿透)

arcgis根据矢量范围裁取tif影像(栅格数据)、批量合并shp文件、根据矢量范围裁取区域内的矢量,输出地理坐标系、转换16位TIF影像的像素深度至8位、shp文件创建和矢量框标绘设置

The GUI interface of yolov3 (simple, image detection)

R language installation tutorial | graphic introduction is super detailed

什么叫做 inode ?带你理解 inode 和对于创建文件和删除文件时 inode 都提供了哪些帮助。

Find the cause of program dead cycle through debugging

Lua script Wireshark plug-in to resolve third-party private protocols
随机推荐
Qpprogressbar for QT style (QSS) application
二叉树——530.二叉搜索树的最小绝对差
Exercise (3) create a list set (both ArrayList and LinkedList)
Nacos offline service times error errcode: 500
[learning notes] solid works operation record
LeetCode 0135. 分发糖果
redis-基本数据类型(String/list/Set/Hash/Zset)
Song of statistics lyrics
二叉树——700.二叉搜索树中的搜索
2022-07-18 study notes of group 5 self-cultivation class (every day)
Ratio of learning_ add,ratio_ subtract,ratio_ multiply,ratio_ Use of divide
Leetcode 0135. distribute candy
《数据密集型应用系统设计》 - 应用系统概览
二叉树——110. 平衡二叉树
Get the data of Mafeng Hotel
什么是奇偶校验?如何用C语言实现?
Leetcode169-多数元素详解
S4/hana mm & SD EDI Nast based integrated configuration (orders, ordrsp, desadv, invoice)
程序环境和预处理
@Autowired注解的底层原理