2
#PromQL# 速查手册:常用 PromQL 命令
source link: https://lottewong.github.io/2022/01/09/%E9%80%9F%E6%9F%A5%E6%89%8B%E5%86%8C%E4%B9%8B%E5%B8%B8%E7%94%A8PromQL%E5%91%BD%E4%BB%A4/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
4 months ago
2 minutes read (About 308 words)
6 visits
#PromQL# 速查手册:常用 PromQL 命令
覆盖在学习和工作中的常用 PromQL 命令:输入数据类型 / 输出数据类型 / 运算符 / 聚合操作 / 内置函数
目录 Table of Contents
输入数据类型
- 字符型:”string” 或 ‘string’ 或 str∈gstr∈g
- 整数型:0
- 浮点型:0.0
输出数据类型
- 瞬时数据(instant vector):
qps
- 区间数据(range vector):
qps[1d]
- 标量数据(scalar):
count(qps)
运算符
算术运算符
- 乘、除、取模
比较运算符
- 精确匹配:
==
和!=
- 正则匹配:
=~
和!~
逻辑运算符
and
和unless
or
by
和without
条件运算符
{key ? value}
聚合操作
sum, min, max, avg, stddev, stdvar, count
count
:对键计数,count(qps)
count_values
:对值计数,count_values("count", qps)
bottomk, topk
:后 k 位 -bottomk(3, qps)
;前 k 位 -topk(3, qps)
quantile
:分位数,quantile(0.5, qps)
offset
:时间前偏移量,offset 1d
内置函数
rate
:平均的增长率irate
:瞬时的增长率increase
:每分钟的增量
#
PromQL
Comments
Related Issues not found
Please contact @LotteWong to initialize the comment
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK