本文介绍Elasticsearch Serverless对PromQL操作符和函数的支持情况。
操作符
二元运算符
运算符 | 类型 | 是否支持 | 说明 |
---|---|---|---|
addOp | binaryOperator | 是 | 加、减 |
andUnlessOp | binaryOperator | 是 | 集合运算(and、or、unless) |
compareOp | binaryOperator | 是 | 比较(==,>=, >, <=, <, !=) |
multOp | binaryOperator | 是 | 乘、除、取模 |
orOp | binaryOperator | 是 | 集合运算(or) |
powOp | binaryOperator | 是 | 幂乘 |
聚合操作符
操作符 | 是否支持 | 说明 |
---|---|---|
avg(calculate the average over dimensions) | 是 | 平均值 |
bottomk(smallest k elements by sample value) | 是 | 样本值最小的k个元素 |
count(count number of elements in the vector) | 是 | 计数 |
count_values(count number of elements with the same value) | 是 | 对值进行计数 |
group(all values in the resulting vector are 1) | 否 | 结果向量中的所有值均为1 |
max(select maximum over dimensions) | 是 | 最大值 |
min(select minimum over dimensions) | 是 | 最小值 |
quantile(calculate φ-quantile (0 ≤ φ ≤ 1) over dimensions) | 是 | 分布统计 |
sum(calculate sum over dimensions) | 是 | 求和 |
stddev(calculate population standard deviation over dimensions) | 否 | 标准差 |
stdvar(calculate population standard variance over dimensions) | 否 | 标准差异 |
topk(largest k elements by sample value) | 是 | 样本值中最大的k个元素 |
其他操作符
表达式 | 类型 | 是否支持 | 说明 |
---|---|---|---|
aggregation | vector | 是 | 聚合运算 |
function | vector | 是 | 函数 |
grouping | group | 否 | group聚合,包括on、ignoring、group_left、group_right |
instantSelector | vector | 是 | 瞬时选择器 |
labelMatcher | vector | 是 | 标签匹配 |
literal | vector | 是 | 常量 |
matrixSelector | vector | 是 | 向量选择器 |
offset | vector | 是 | 偏移量 |
unaryOp | binaryOperator | 是 | 正、负 |
函数
Function | 是否支持 |
---|---|
abs(v instant-vector) | 是 |
absent(v instant-vector) | 否 |
absent_over_time(v range-vector) | 否 |
ceil(v instant-vector) | 是 |
changes(v range-vector) | 否 |
clamp(v instant-vector, min scalar, max scalar) | 是 |
clamp_max(v instant-vector, max scalar) | 是 |
clamp_min(v instant-vector, min scalar) | 是 |
day_of_month(v=vector(time()) instant-vector) | 是 |
day_of_week(v=vector(time()) instant-vector) | 是 |
days_in_month(v=vector(time()) instant-vector) | 否 |
delta(v range-vector) | 是 |
deriv(v range-vector) | 否 |
exp(v instant-vector) | 是 |
floor(v instant-vector) | 是 |
histogram_quantile(φ scalar, b instant-vector) | 否 |
holt_winters(v range-vector, sf scalar, tf scalar) | 否 |
hour(v=vector(time()) instant-vector) | 是 |
idelta(v range-vector) | 是 |
increase(v range-vector) | 是 |
irate(v range-vector) | 是 |
label_join(v instant-vector, dst_label string, separator string, src_label_1 string, src_label_2 string, ...) | 否 |
label_replace(v instant-vector, dst_label string, replacement string, src_label string, regex string) | 否 |
ln(v instant-vector) | 是 |
log2(v instant-vector) | 否 |
log10(v instant-vector) | 是 |
minute(v=vector(time()) instant-vector) | 是 |
month(v=vector(time()) instant-vector) | 是 |
predict_linear(v range-vector, t scalar) | 否 |
rate(v range-vector) | 是 |
resets(v range-vector) | 否 |
round(v instant-vector, to_nearest=1 scalar) | 否 |
scalar(v instant-vector) | 否 |
sgn(v instant-vector) | 是 |
sort(v instant-vector) | 否 |
sort_desc() | 否 |
sqrt(v instant-vector) | 是 |
time() | 否 |
timestamp(v instant-vector) | 是 |
vector(s scalar) | 否 |
year(v=vector(time()) instant-vector) | 是 |
<aggregation>_over_time()
Function | 是否支持 |
---|---|
avg_over_time(range-vector) | 是 |
count_over_time(range-vector) | 是 |
last_over_time(range-vector) | 是 |
max_over_time(range-vector) | 是 |
min_over_time(range-vector) | 是 |
present_over_time(range-vector) | 否 |
quantile_over_time(scalar, range-vector) | 是 |
stddev_over_time(range-vector) | 否 |
stdvar_over_time(range-vector) | 否 |
sum_over_time(range-vector) | 是 |
Trigonometric Functions
Function | 是否支持 |
---|---|
acos(v instant-vector) | 是 |
acosh(v instant-vector) | 是 |
asin(v instant-vector) | 是 |
asinh(v instant-vector) | 否 |
atan(v instant-vector) | 是 |
atanh(v instant-vector) | 否 |
cos(v instant-vector) | 是 |
cosh(v instant-vector) | 是 |
deg(v instant-vector) | 是 |
pi() | 是 |
rad(v instant-vector) | 是 |
sin(v instant-vector) | 是 |
sinh(v instant-vector) | 是 |
tan(v instant-vector) | 是 |
tanh(v instant-vector) | 是 |