mirror of
https://github.com/prometheus/prometheus.git
synced 2025-08-05 13:47:10 +02:00
Merge pull request #16585 from kapillamba4/fix/16393-strict
Convert PromQL tests to new syntax via basic migration mode
This commit is contained in:
commit
b7f984d6d2
126
promql/promqltest/testdata/aggregators.test
vendored
126
promql/promqltest/testdata/aggregators.test
vendored
@ -232,30 +232,38 @@ load 5m
|
||||
http_requests_histogram{job="api-server", instance="3", group="canary"} {{schema:2 count:4 sum:10 buckets:[1 0 0 0 1 0 0 1 1]}}
|
||||
|
||||
eval instant at 0m max(http_requests)
|
||||
expect no_info
|
||||
{} 4
|
||||
|
||||
# The histogram is ignored here so the result doesn't change but it has an info annotation now.
|
||||
eval_info instant at 0m max({job="api-server"})
|
||||
eval instant at 0m max({job="api-server"})
|
||||
expect info
|
||||
{} 4
|
||||
|
||||
# The histogram is ignored here so there is no result but it has an info annotation now.
|
||||
eval_info instant at 0m max(http_requests_histogram)
|
||||
eval instant at 0m max(http_requests_histogram)
|
||||
expect info
|
||||
|
||||
eval instant at 0m min(http_requests)
|
||||
expect no_info
|
||||
{} 1
|
||||
|
||||
# The histogram is ignored here so the result doesn't change but it has an info annotation now.
|
||||
eval_info instant at 0m min({job="api-server"})
|
||||
eval instant at 0m min({job="api-server"})
|
||||
expect info
|
||||
{} 1
|
||||
|
||||
# The histogram is ignored here so there is no result but it has an info annotation now.
|
||||
eval_info instant at 0m min(http_requests_histogram)
|
||||
eval instant at 0m min(http_requests_histogram)
|
||||
expect info
|
||||
|
||||
eval instant at 0m max by (group) (http_requests)
|
||||
expect no_info
|
||||
{group="production"} 2
|
||||
{group="canary"} 4
|
||||
|
||||
eval instant at 0m min by (group) (http_requests)
|
||||
expect no_info
|
||||
{group="production"} 1
|
||||
{group="canary"} 3
|
||||
|
||||
@ -276,26 +284,31 @@ load 5m
|
||||
http_requests_histogram{job="api-server", instance="3", group="production"} {{schema:0 sum:20 count:20}}x11
|
||||
foo 1+1x9 3
|
||||
|
||||
eval_ordered instant at 50m topk(3, http_requests)
|
||||
eval instant at 50m topk(3, http_requests)
|
||||
expect ordered
|
||||
http_requests{group="canary", instance="1", job="app-server"} 800
|
||||
http_requests{group="canary", instance="0", job="app-server"} 700
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
|
||||
eval_ordered instant at 50m topk((3), (http_requests))
|
||||
eval instant at 50m topk((3), (http_requests))
|
||||
expect ordered
|
||||
http_requests{group="canary", instance="1", job="app-server"} 800
|
||||
http_requests{group="canary", instance="0", job="app-server"} 700
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
|
||||
eval_ordered instant at 50m topk(5, http_requests{group="canary",job="app-server"})
|
||||
eval instant at 50m topk(5, http_requests{group="canary",job="app-server"})
|
||||
expect ordered
|
||||
http_requests{group="canary", instance="1", job="app-server"} 800
|
||||
http_requests{group="canary", instance="0", job="app-server"} 700
|
||||
|
||||
eval_ordered instant at 50m bottomk(3, http_requests)
|
||||
eval instant at 50m bottomk(3, http_requests)
|
||||
expect ordered
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
http_requests{group="production", instance="1", job="api-server"} 200
|
||||
http_requests{group="canary", instance="0", job="api-server"} 300
|
||||
|
||||
eval_ordered instant at 50m bottomk(5, http_requests{group="canary",job="app-server"})
|
||||
eval instant at 50m bottomk(5, http_requests{group="canary",job="app-server"})
|
||||
expect ordered
|
||||
http_requests{group="canary", instance="0", job="app-server"} 700
|
||||
http_requests{group="canary", instance="1", job="app-server"} 800
|
||||
|
||||
@ -309,33 +322,39 @@ eval instant at 50m bottomk by (group) (2, http_requests)
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
http_requests{group="production", instance="1", job="api-server"} 200
|
||||
|
||||
eval_ordered instant at 50m bottomk by (group) (2, http_requests{group="production"})
|
||||
eval instant at 50m bottomk by (group) (2, http_requests{group="production"})
|
||||
expect ordered
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
http_requests{group="production", instance="1", job="api-server"} 200
|
||||
|
||||
# Test NaN is sorted away from the top/bottom.
|
||||
eval_ordered instant at 50m topk(3, http_requests{job="api-server",group="production"})
|
||||
eval instant at 50m topk(3, http_requests{job="api-server",group="production"})
|
||||
expect ordered
|
||||
http_requests{job="api-server", instance="1", group="production"} 200
|
||||
http_requests{job="api-server", instance="0", group="production"} 100
|
||||
http_requests{job="api-server", instance="2", group="production"} NaN
|
||||
|
||||
eval_ordered instant at 50m bottomk(3, http_requests{job="api-server",group="production"})
|
||||
eval instant at 50m bottomk(3, http_requests{job="api-server",group="production"})
|
||||
expect ordered
|
||||
http_requests{job="api-server", instance="0", group="production"} 100
|
||||
http_requests{job="api-server", instance="1", group="production"} 200
|
||||
http_requests{job="api-server", instance="2", group="production"} NaN
|
||||
|
||||
# Test topk and bottomk allocate min(k, input_vector) for results vector
|
||||
eval_ordered instant at 50m bottomk(9999999999, http_requests{job="app-server",group="canary"})
|
||||
eval instant at 50m bottomk(9999999999, http_requests{job="app-server",group="canary"})
|
||||
expect ordered
|
||||
http_requests{group="canary", instance="0", job="app-server"} 700
|
||||
http_requests{group="canary", instance="1", job="app-server"} 800
|
||||
|
||||
eval_ordered instant at 50m topk(9999999999, http_requests{job="api-server",group="production"})
|
||||
eval instant at 50m topk(9999999999, http_requests{job="api-server",group="production"})
|
||||
expect ordered
|
||||
http_requests{job="api-server", instance="1", group="production"} 200
|
||||
http_requests{job="api-server", instance="0", group="production"} 100
|
||||
http_requests{job="api-server", instance="2", group="production"} NaN
|
||||
|
||||
# Bug #5276.
|
||||
eval_ordered instant at 50m topk(scalar(foo), http_requests)
|
||||
eval instant at 50m topk(scalar(foo), http_requests)
|
||||
expect ordered
|
||||
http_requests{group="canary", instance="1", job="app-server"} 800
|
||||
http_requests{group="canary", instance="0", job="app-server"} 700
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
@ -348,42 +367,54 @@ eval range from 0m to 50m step 5m count(bottomk(scalar(foo), http_requests))
|
||||
{} 1 2 3 4 5 6 7 8 9 9 3
|
||||
|
||||
# Tests for histogram: should ignore histograms.
|
||||
eval_info instant at 50m topk(100, http_requests_histogram)
|
||||
eval instant at 50m topk(100, http_requests_histogram)
|
||||
expect info
|
||||
#empty
|
||||
|
||||
eval_info range from 0 to 50m step 5m topk(100, http_requests_histogram)
|
||||
eval range from 0 to 50m step 5m topk(100, http_requests_histogram)
|
||||
expect info
|
||||
#empty
|
||||
|
||||
eval_info instant at 50m topk(1, {__name__=~"http_requests(_histogram)?"})
|
||||
eval instant at 50m topk(1, {__name__=~"http_requests(_histogram)?"})
|
||||
expect info
|
||||
{__name__="http_requests", group="canary", instance="1", job="app-server"} 800
|
||||
|
||||
eval_info instant at 50m count(topk(1000, {__name__=~"http_requests(_histogram)?"}))
|
||||
eval instant at 50m count(topk(1000, {__name__=~"http_requests(_histogram)?"}))
|
||||
expect info
|
||||
{} 9
|
||||
|
||||
eval_info range from 0 to 50m step 5m count(topk(1000, {__name__=~"http_requests(_histogram)?"}))
|
||||
eval range from 0 to 50m step 5m count(topk(1000, {__name__=~"http_requests(_histogram)?"}))
|
||||
expect info
|
||||
{} 9x10
|
||||
|
||||
eval_info instant at 50m topk by (instance) (1, {__name__=~"http_requests(_histogram)?"})
|
||||
eval instant at 50m topk by (instance) (1, {__name__=~"http_requests(_histogram)?"})
|
||||
expect info
|
||||
{__name__="http_requests", group="canary", instance="0", job="app-server"} 700
|
||||
{__name__="http_requests", group="canary", instance="1", job="app-server"} 800
|
||||
{__name__="http_requests", group="production", instance="2", job="api-server"} NaN
|
||||
|
||||
eval_info instant at 50m bottomk(100, http_requests_histogram)
|
||||
eval instant at 50m bottomk(100, http_requests_histogram)
|
||||
expect info
|
||||
#empty
|
||||
|
||||
eval_info range from 0 to 50m step 5m bottomk(100, http_requests_histogram)
|
||||
eval range from 0 to 50m step 5m bottomk(100, http_requests_histogram)
|
||||
expect info
|
||||
#empty
|
||||
|
||||
eval_info instant at 50m bottomk(1, {__name__=~"http_requests(_histogram)?"})
|
||||
eval instant at 50m bottomk(1, {__name__=~"http_requests(_histogram)?"})
|
||||
expect info
|
||||
{__name__="http_requests", group="production", instance="0", job="api-server"} 100
|
||||
|
||||
eval_info instant at 50m count(bottomk(1000, {__name__=~"http_requests(_histogram)?"}))
|
||||
eval instant at 50m count(bottomk(1000, {__name__=~"http_requests(_histogram)?"}))
|
||||
expect info
|
||||
{} 9
|
||||
|
||||
eval_info range from 0 to 50m step 5m count(bottomk(1000, {__name__=~"http_requests(_histogram)?"}))
|
||||
eval range from 0 to 50m step 5m count(bottomk(1000, {__name__=~"http_requests(_histogram)?"}))
|
||||
expect info
|
||||
{} 9x10
|
||||
|
||||
eval_info instant at 50m bottomk by (instance) (1, {__name__=~"http_requests(_histogram)?"})
|
||||
eval instant at 50m bottomk by (instance) (1, {__name__=~"http_requests(_histogram)?"})
|
||||
expect info
|
||||
{__name__="http_requests", group="production", instance="0", job="api-server"} 100
|
||||
{__name__="http_requests", group="production", instance="1", job="api-server"} 200
|
||||
{__name__="http_requests", group="production", instance="2", job="api-server"} NaN
|
||||
@ -447,8 +478,8 @@ eval instant at 1m count_values by (job, group)("job", version)
|
||||
{job="{count:20, sum:10, [-2,-1):2, [-1,-0.5):1, [-0.001,0.001]:2, (0.5,1]:1, (1,2]:2}", group="canary"} 2
|
||||
|
||||
# Test an invalid label value.
|
||||
eval_fail instant at 0 count_values("a\xc5z", version)
|
||||
expected_fail_message invalid label name "a\xc5z"
|
||||
eval instant at 0 count_values("a\xc5z", version)
|
||||
expect fail msg:invalid label name "a\xc5z"
|
||||
|
||||
# Tests for quantile.
|
||||
clear
|
||||
@ -471,6 +502,7 @@ load 10s
|
||||
# 80th percentile.
|
||||
# The NaN sample is treated as the smallest possible value.
|
||||
eval instant at 1m quantile without(point)(0.8, data)
|
||||
expect no_info
|
||||
{test="two samples"} 0.8
|
||||
{test="three samples"} 1.6
|
||||
{test="uneven samples"} 2.8
|
||||
@ -485,14 +517,16 @@ eval instant at 1m quantile without(point)(0.2, data)
|
||||
{test="NaN sample"} NaN
|
||||
|
||||
# The histogram is ignored here so the result doesn't change but it has an info annotation now.
|
||||
eval_info instant at 1m quantile without(point)(0.8, {__name__=~"data(_histogram)?"})
|
||||
eval instant at 1m quantile without(point)(0.8, {__name__=~"data(_histogram)?"})
|
||||
expect info
|
||||
{test="two samples"} 0.8
|
||||
{test="three samples"} 1.6
|
||||
{test="uneven samples"} 2.8
|
||||
{test="NaN sample"} 0.6
|
||||
|
||||
# The histogram is ignored here so there is no result but it has an info annotation now.
|
||||
eval_info instant at 1m quantile(0.8, data_histogram)
|
||||
eval instant at 1m quantile(0.8, data_histogram)
|
||||
expect info
|
||||
|
||||
# Bug #5276.
|
||||
eval instant at 1m quantile without(point)(scalar(foo), data)
|
||||
@ -763,22 +797,28 @@ load 5m
|
||||
series{label="c"} {{schema:1 sum:15 count:10 buckets:[3 2 5 7 9]}}
|
||||
|
||||
# The histogram is ignored here so the result doesn't change but it has an info annotation now.
|
||||
eval_info instant at 0m stddev(series)
|
||||
eval instant at 0m stddev(series)
|
||||
expect info
|
||||
{} 0.5
|
||||
|
||||
eval_info instant at 0m stdvar(series)
|
||||
eval instant at 0m stdvar(series)
|
||||
expect info
|
||||
{} 0.25
|
||||
|
||||
# The histogram is ignored here so there is no result but it has an info annotation now.
|
||||
eval_info instant at 0m stddev({label="c"})
|
||||
eval instant at 0m stddev({label="c"})
|
||||
expect info
|
||||
|
||||
eval_info instant at 0m stdvar({label="c"})
|
||||
eval instant at 0m stdvar({label="c"})
|
||||
expect info
|
||||
|
||||
eval_info instant at 0m stddev by (label) (series)
|
||||
eval instant at 0m stddev by (label) (series)
|
||||
expect info
|
||||
{label="a"} 0
|
||||
{label="b"} 0
|
||||
|
||||
eval_info instant at 0m stdvar by (label) (series)
|
||||
eval instant at 0m stdvar by (label) (series)
|
||||
expect info
|
||||
{label="a"} 0
|
||||
{label="b"} 0
|
||||
|
||||
@ -789,17 +829,21 @@ load 5m
|
||||
series{label="b"} 1
|
||||
series{label="c"} 2
|
||||
|
||||
eval_info instant at 0m stddev(series)
|
||||
eval instant at 0m stddev(series)
|
||||
expect info
|
||||
{} 0.5
|
||||
|
||||
eval_info instant at 0m stdvar(series)
|
||||
eval instant at 0m stdvar(series)
|
||||
expect info
|
||||
{} 0.25
|
||||
|
||||
eval_info instant at 0m stddev by (label) (series)
|
||||
eval instant at 0m stddev by (label) (series)
|
||||
expect info
|
||||
{label="b"} 0
|
||||
{label="c"} 0
|
||||
|
||||
eval_info instant at 0m stdvar by (label) (series)
|
||||
eval instant at 0m stdvar by (label) (series)
|
||||
expect info
|
||||
{label="b"} 0
|
||||
{label="c"} 0
|
||||
|
||||
|
3
promql/promqltest/testdata/at_modifier.test
vendored
3
promql/promqltest/testdata/at_modifier.test
vendored
@ -90,8 +90,7 @@ eval instant at 25s sum_over_time(metric{job="1"}[100] offset 50s @ 100)
|
||||
eval instant at 25s metric{job="1"} @ 50 + metric{job="1"} @ 100
|
||||
{job="1"} 15
|
||||
|
||||
# Note that this triggers an info annotation because we are rate'ing a metric that does not end in `_total`.
|
||||
eval_info instant at 25s rate(metric{job="1"}[100s] @ 100) + label_replace(rate(metric{job="2"}[123s] @ 200), "job", "1", "", "")
|
||||
eval instant at 25s rate(metric{job="1"}[100s] @ 100) + label_replace(rate(metric{job="2"}[123s] @ 200), "job", "1", "", "")
|
||||
{job="1"} 0.3
|
||||
|
||||
eval instant at 25s sum_over_time(metric{job="1"}[100s] @ 100) + label_replace(sum_over_time(metric{job="2"}[100s] @ 100), "job", "1", "", "")
|
||||
|
3
promql/promqltest/testdata/collision.test
vendored
3
promql/promqltest/testdata/collision.test
vendored
@ -17,6 +17,7 @@ load 5m
|
||||
testmetric1{src="a",dst="b"} 0
|
||||
testmetric2{src="a",dst="b"} 1
|
||||
|
||||
eval_fail instant at 0m ceil({__name__=~'testmetric1|testmetric2'})
|
||||
eval instant at 0m ceil({__name__=~'testmetric1|testmetric2'})
|
||||
expect fail
|
||||
|
||||
clear
|
||||
|
189
promql/promqltest/testdata/functions.test
vendored
189
promql/promqltest/testdata/functions.test
vendored
@ -228,37 +228,48 @@ load 5m
|
||||
http_requests_histogram{path="/g"} 0 0 {{schema:-53 sum:3 count:3 custom_values:[1] buckets:[3]}} {{schema:-53 sum:3 count:3 custom_values:[5 10] buckets:[3]}}
|
||||
|
||||
eval instant at 50m irate(http_requests_total[50m])
|
||||
expect no_warn
|
||||
{path="/foo"} .03333333333333333333
|
||||
{path="/bar"} .03333333333333333333
|
||||
|
||||
# Counter reset.
|
||||
eval instant at 30m irate(http_requests_total[50m])
|
||||
expect no_warn
|
||||
{path="/foo"} .03333333333333333333
|
||||
{path="/bar"} 0
|
||||
|
||||
eval range from 0 to 20m step 5m irate(http_requests_nan[15m1s])
|
||||
expect no_warn
|
||||
{} _ NaN NaN NaN 0.02
|
||||
|
||||
eval instant at 20m irate(http_requests_histogram{path="/a"}[20m])
|
||||
expect no_warn
|
||||
{path="/a"} {{sum:0.01 count:0.01 counter_reset_hint:gauge}}
|
||||
|
||||
eval instant at 20m irate(http_requests_histogram{path="/b"}[20m])
|
||||
expect no_warn
|
||||
{path="/b"} {{sum:0.01 count:0.01 counter_reset_hint:gauge}}
|
||||
|
||||
eval instant at 20m irate(http_requests_histogram{path="/b"}[6m])
|
||||
expect no_warn
|
||||
|
||||
eval_warn instant at 20m irate(http_requests_histogram{path="/c"}[20m])
|
||||
eval instant at 20m irate(http_requests_histogram{path="/c"}[20m])
|
||||
expect warn
|
||||
{path="/c"} {{sum:0.01 count:0.01 counter_reset_hint:gauge}}
|
||||
|
||||
eval_warn instant at 20m irate(http_requests_histogram{path="/d"}[20m])
|
||||
eval instant at 20m irate(http_requests_histogram{path="/d"}[20m])
|
||||
expect warn
|
||||
{path="/d"} {{sum:0.01 count:0.01 counter_reset_hint:gauge}}
|
||||
|
||||
eval_warn instant at 20m irate(http_requests_histogram{path="/e"}[20m])
|
||||
eval instant at 20m irate(http_requests_histogram{path="/e"}[20m])
|
||||
expect warn
|
||||
|
||||
eval instant at 20m irate(http_requests_histogram{path="/f"}[20m])
|
||||
expect no_warn
|
||||
{path="/f"} {{schema:-53 sum:0.01 count:0.01 custom_values:[5 10] buckets:[0.01]}}
|
||||
|
||||
eval instant at 20m irate(http_requests_histogram{path="/g"}[20m])
|
||||
expect no_warn
|
||||
{path="/g"} {{schema:-53 sum:0.01 count:0.01 custom_values:[5 10] buckets:[0.01]}}
|
||||
|
||||
clear
|
||||
@ -272,18 +283,22 @@ load 5m
|
||||
http_requests_mix{path="/foo"} 0 50 100 {{schema:0 sum:0 count:0 buckets:[0 0 0] counter_reset_hint:gauge}} {{schema:0 sum:1 count:2 buckets:[1 1 1] counter_reset_hint:gauge}}
|
||||
|
||||
eval instant at 20m delta(http_requests[20m])
|
||||
expect no_warn
|
||||
{path="/foo"} 200
|
||||
{path="/bar"} -200
|
||||
|
||||
eval instant at 20m delta(http_requests_gauge[20m])
|
||||
expect no_warn
|
||||
{path="/foo"} {{schema:0 sum:4 count:8 buckets:[4 4 4]}}
|
||||
|
||||
# delta emits warn annotation for non-gauge histogram types.
|
||||
eval_warn instant at 20m delta(http_requests_counter[20m])
|
||||
eval instant at 20m delta(http_requests_counter[20m])
|
||||
expect warn
|
||||
{path="/foo"} {{schema:0 sum:4 count:8 buckets:[4 4 4]}}
|
||||
|
||||
# delta emits warn annotation for mix of histogram and floats.
|
||||
eval_warn instant at 20m delta(http_requests_mix[20m])
|
||||
eval instant at 20m delta(http_requests_mix[20m])
|
||||
expect warn
|
||||
#empty
|
||||
|
||||
clear
|
||||
@ -302,31 +317,41 @@ load 5m
|
||||
http_requests_histogram{path="/g"} 0 0 {{schema:-53 sum:1 count:1 custom_values:[1] buckets:[2] counter_reset_hint:gauge}} {{schema:-53 sum:1 count:1 custom_values:[5 10] buckets:[1] counter_reset_hint:gauge}}
|
||||
|
||||
eval instant at 20m idelta(http_requests[20m])
|
||||
expect no_warn
|
||||
{path="/foo"} 50
|
||||
{path="/bar"} -50
|
||||
|
||||
eval range from 0 to 20m step 5m idelta(http_requests_nan[15m1s])
|
||||
expect no_warn
|
||||
{} _ NaN NaN NaN 6
|
||||
|
||||
eval instant at 20m idelta(http_requests_histogram{path="/a"}[20m])
|
||||
expect no_warn
|
||||
{path="/a"} {{sum:1 count:3 counter_reset_hint:gauge}}
|
||||
|
||||
eval instant at 20m idelta(http_requests_histogram{path="/b"}[20m])
|
||||
expect no_warn
|
||||
{path="/b"} {{sum:1 count:1 counter_reset_hint:gauge}}
|
||||
|
||||
eval instant at 20m idelta(http_requests_histogram{path="/b"}[6m])
|
||||
expect no_warn
|
||||
|
||||
eval_warn instant at 20m idelta(http_requests_histogram{path="/c"}[20m])
|
||||
eval instant at 20m idelta(http_requests_histogram{path="/c"}[20m])
|
||||
expect warn
|
||||
{path="/c"} {{sum:1 count:1 counter_reset_hint:gauge}}
|
||||
|
||||
eval_warn instant at 20m idelta(http_requests_histogram{path="/d"}[20m])
|
||||
eval instant at 20m idelta(http_requests_histogram{path="/d"}[20m])
|
||||
expect warn
|
||||
{path="/d"} {{sum:1 count:1 counter_reset_hint:gauge}}
|
||||
|
||||
eval_warn instant at 20m idelta(http_requests_histogram{path="/e"}[20m])
|
||||
eval instant at 20m idelta(http_requests_histogram{path="/e"}[20m])
|
||||
expect warn
|
||||
|
||||
eval_warn instant at 20m idelta(http_requests_histogram{path="/f"}[20m])
|
||||
eval instant at 20m idelta(http_requests_histogram{path="/f"}[20m])
|
||||
expect warn
|
||||
|
||||
eval_warn instant at 20m idelta(http_requests_histogram{path="/g"}[20m])
|
||||
eval instant at 20m idelta(http_requests_histogram{path="/g"}[20m])
|
||||
expect warn
|
||||
|
||||
clear
|
||||
|
||||
@ -341,28 +366,36 @@ load 5m
|
||||
|
||||
# deriv should return the same as rate in simple cases.
|
||||
eval instant at 50m rate(http_requests_total{group="canary", instance="1", job="app-server"}[50m])
|
||||
expect no_info
|
||||
{group="canary", instance="1", job="app-server"} 0.26666666666666666
|
||||
|
||||
eval instant at 50m deriv(http_requests_total{group="canary", instance="1", job="app-server"}[50m])
|
||||
expect no_info
|
||||
{group="canary", instance="1", job="app-server"} 0.26666666666666666
|
||||
|
||||
# deriv should return correct result.
|
||||
eval instant at 50m deriv(testcounter_reset_middle_total[100m])
|
||||
expect no_info
|
||||
{} 0.010606060606060607
|
||||
|
||||
# deriv should ignore histograms in a mixed range of floats and histograms, flagged by an info annotation.
|
||||
eval_info instant at 110m deriv(http_requests_mix{group="canary", instance="1", job="app-server"}[110m])
|
||||
eval instant at 110m deriv(http_requests_mix{group="canary", instance="1", job="app-server"}[110m])
|
||||
expect info
|
||||
{group="canary", instance="1", job="app-server"} 0.26666666666666666
|
||||
|
||||
eval_info instant at 100m deriv(testcounter_reset_middle_mix[110m])
|
||||
eval instant at 100m deriv(testcounter_reset_middle_mix[110m])
|
||||
expect info
|
||||
{} 0.010606060606060607
|
||||
|
||||
# deriv should silently ignore ranges consisting only of histograms.
|
||||
eval instant at 50m deriv(http_requests_histogram[60m])
|
||||
expect no_info
|
||||
expect no_warn
|
||||
#empty
|
||||
|
||||
# deriv should return NaN in case of +Inf or -Inf found.
|
||||
eval instant at 100m deriv(http_requests_inf[100m])
|
||||
expect no_info
|
||||
{job="app-server", instance="1", group="canary"} NaN
|
||||
|
||||
# predict_linear should return correct result.
|
||||
@ -380,35 +413,45 @@ eval instant at 100m deriv(http_requests_inf[100m])
|
||||
# intercept at t=3000: 38.63636363636364
|
||||
# intercept at t=3000+3600: 76.81818181818181
|
||||
eval instant at 50m predict_linear(testcounter_reset_middle_total[50m], 3600)
|
||||
expect no_info
|
||||
{} 70
|
||||
|
||||
eval instant at 50m predict_linear(testcounter_reset_middle_total[50m], 1h)
|
||||
expect no_info
|
||||
{} 70
|
||||
|
||||
# intercept at t = 3000+3600 = 6600
|
||||
eval instant at 50m predict_linear(testcounter_reset_middle_total[55m] @ 3000, 3600)
|
||||
expect no_info
|
||||
{} 76.81818181818181
|
||||
|
||||
eval instant at 50m predict_linear(testcounter_reset_middle_total[55m] @ 3000, 1h)
|
||||
expect no_info
|
||||
{} 76.81818181818181
|
||||
|
||||
# intercept at t = 600+3600 = 4200
|
||||
eval instant at 10m predict_linear(testcounter_reset_middle_total[55m] @ 3000, 3600)
|
||||
expect no_info
|
||||
{} 51.36363636363637
|
||||
|
||||
# intercept at t = 4200+3600 = 7800
|
||||
eval instant at 70m predict_linear(testcounter_reset_middle_total[55m] @ 3000, 3600)
|
||||
expect no_info
|
||||
{} 89.54545454545455
|
||||
|
||||
# predict_linear should ignore histograms in a mixed range of floats and histograms, flagged by an info annotation.
|
||||
eval_info instant at 60m predict_linear(testcounter_reset_middle_mix[60m], 3000)
|
||||
eval instant at 60m predict_linear(testcounter_reset_middle_mix[60m], 3000)
|
||||
expect info
|
||||
{} 70
|
||||
|
||||
eval_info instant at 60m predict_linear(testcounter_reset_middle_mix[60m], 50m)
|
||||
eval instant at 60m predict_linear(testcounter_reset_middle_mix[60m], 50m)
|
||||
expect info
|
||||
{} 70
|
||||
|
||||
# predict_linear should silently ignore ranges consisting only of histograms.
|
||||
eval instant at 60m predict_linear(http_requests_histogram[60m], 50m)
|
||||
expect no_info
|
||||
expect no_warn
|
||||
#empty
|
||||
|
||||
# predict_linear should return NaN in case of +Inf or -Inf found.
|
||||
@ -471,13 +514,16 @@ eval instant at 0m label_replace(testmetric, "dst", "", "dst", ".*")
|
||||
testmetric{src="source-value-20"} 1
|
||||
|
||||
# label_replace fails when the regex is invalid.
|
||||
eval_fail instant at 0m label_replace(testmetric, "dst", "value-$1", "src", "(.*")
|
||||
eval instant at 0m label_replace(testmetric, "dst", "value-$1", "src", "(.*")
|
||||
expect fail
|
||||
|
||||
# label_replace fails when the destination label name is not a valid Prometheus label name.
|
||||
eval_fail instant at 0m label_replace(testmetric, "\xff", "", "src", "(.*)")
|
||||
eval instant at 0m label_replace(testmetric, "\xff", "", "src", "(.*)")
|
||||
expect fail
|
||||
|
||||
# label_replace fails when there would be duplicated identical output label sets.
|
||||
eval_fail instant at 0m label_replace(testmetric, "src", "", "", "")
|
||||
eval instant at 0m label_replace(testmetric, "src", "", "", "")
|
||||
expect fail
|
||||
|
||||
clear
|
||||
|
||||
@ -540,8 +586,8 @@ eval instant at 0m label_join(testmetric1, "dst", ", ", "src", "src1", "src2")
|
||||
testmetric1{src="foo",src1="bar",src2="foobar",dst="foo, bar, foobar"} 0
|
||||
testmetric1{src="fizz",src1="buzz",src2="fizzbuzz",dst="fizz, buzz, fizzbuzz"} 1
|
||||
|
||||
eval_fail instant at 0m label_join(dup, "label", "", "this")
|
||||
expected_fail_message vector cannot contain metrics with the same labelset
|
||||
eval instant at 0m label_join(dup, "label", "", "this")
|
||||
expect fail msg:vector cannot contain metrics with the same labelset
|
||||
|
||||
clear
|
||||
|
||||
@ -652,7 +698,8 @@ load 5m
|
||||
http_requests{job="app-server", instance="1", group="canary"} 0+80x10
|
||||
http_requests{job="app-server", instance="2", group="canary"} {{schema:0 sum:1 count:1}}x15
|
||||
|
||||
eval_ordered instant at 50m sort(http_requests)
|
||||
eval instant at 50m sort(http_requests)
|
||||
expect ordered
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
http_requests{group="production", instance="1", job="api-server"} 200
|
||||
http_requests{group="canary", instance="0", job="api-server"} 300
|
||||
@ -663,7 +710,8 @@ eval_ordered instant at 50m sort(http_requests)
|
||||
http_requests{group="canary", instance="1", job="app-server"} 800
|
||||
http_requests{group="canary", instance="2", job="api-server"} NaN
|
||||
|
||||
eval_ordered instant at 50m sort_desc(http_requests)
|
||||
eval instant at 50m sort_desc(http_requests)
|
||||
expect ordered
|
||||
http_requests{group="canary", instance="1", job="app-server"} 800
|
||||
http_requests{group="canary", instance="0", job="app-server"} 700
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
@ -701,7 +749,8 @@ load 5m
|
||||
node_uname_info{job="node_exporter", instance="4m5", release="1.11.3"} 0+10x10
|
||||
node_uname_info{job="node_exporter", instance="4m1000", release="1.111.3"} 0+10x10
|
||||
|
||||
eval_ordered instant at 50m sort_by_label(http_requests, "instance")
|
||||
eval instant at 50m sort_by_label(http_requests, "instance")
|
||||
expect ordered
|
||||
http_requests{group="canary", instance="0", job="api-server"} 300
|
||||
http_requests{group="canary", instance="0", job="app-server"} 700
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
@ -713,7 +762,8 @@ eval_ordered instant at 50m sort_by_label(http_requests, "instance")
|
||||
http_requests{group="canary", instance="2", job="api-server"} NaN
|
||||
http_requests{group="production", instance="2", job="api-server"} 100
|
||||
|
||||
eval_ordered instant at 50m sort_by_label(http_requests, "instance", "group")
|
||||
eval instant at 50m sort_by_label(http_requests, "instance", "group")
|
||||
expect ordered
|
||||
http_requests{group="canary", instance="0", job="api-server"} 300
|
||||
http_requests{group="canary", instance="0", job="app-server"} 700
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
@ -725,7 +775,8 @@ eval_ordered instant at 50m sort_by_label(http_requests, "instance", "group")
|
||||
http_requests{group="canary", instance="2", job="api-server"} NaN
|
||||
http_requests{group="production", instance="2", job="api-server"} 100
|
||||
|
||||
eval_ordered instant at 50m sort_by_label(http_requests, "instance", "group")
|
||||
eval instant at 50m sort_by_label(http_requests, "instance", "group")
|
||||
expect ordered
|
||||
http_requests{group="canary", instance="0", job="api-server"} 300
|
||||
http_requests{group="canary", instance="0", job="app-server"} 700
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
@ -737,7 +788,8 @@ eval_ordered instant at 50m sort_by_label(http_requests, "instance", "group")
|
||||
http_requests{group="canary", instance="2", job="api-server"} NaN
|
||||
http_requests{group="production", instance="2", job="api-server"} 100
|
||||
|
||||
eval_ordered instant at 50m sort_by_label(http_requests, "group", "instance", "job")
|
||||
eval instant at 50m sort_by_label(http_requests, "group", "instance", "job")
|
||||
expect ordered
|
||||
http_requests{group="canary", instance="0", job="api-server"} 300
|
||||
http_requests{group="canary", instance="0", job="app-server"} 700
|
||||
http_requests{group="canary", instance="1", job="api-server"} 400
|
||||
@ -749,7 +801,8 @@ eval_ordered instant at 50m sort_by_label(http_requests, "group", "instance", "j
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
http_requests{group="production", instance="2", job="api-server"} 100
|
||||
|
||||
eval_ordered instant at 50m sort_by_label(http_requests, "job", "instance", "group")
|
||||
eval instant at 50m sort_by_label(http_requests, "job", "instance", "group")
|
||||
expect ordered
|
||||
http_requests{group="canary", instance="0", job="api-server"} 300
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
http_requests{group="canary", instance="1", job="api-server"} 400
|
||||
@ -761,7 +814,8 @@ eval_ordered instant at 50m sort_by_label(http_requests, "job", "instance", "gro
|
||||
http_requests{group="canary", instance="1", job="app-server"} 800
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
|
||||
eval_ordered instant at 50m sort_by_label_desc(http_requests, "instance")
|
||||
eval instant at 50m sort_by_label_desc(http_requests, "instance")
|
||||
expect ordered
|
||||
http_requests{group="production", instance="2", job="api-server"} 100
|
||||
http_requests{group="canary", instance="2", job="api-server"} NaN
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
@ -773,7 +827,8 @@ eval_ordered instant at 50m sort_by_label_desc(http_requests, "instance")
|
||||
http_requests{group="canary", instance="0", job="app-server"} 700
|
||||
http_requests{group="canary", instance="0", job="api-server"} 300
|
||||
|
||||
eval_ordered instant at 50m sort_by_label_desc(http_requests, "instance", "group")
|
||||
eval instant at 50m sort_by_label_desc(http_requests, "instance", "group")
|
||||
expect ordered
|
||||
http_requests{group="production", instance="2", job="api-server"} 100
|
||||
http_requests{group="canary", instance="2", job="api-server"} NaN
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
@ -785,7 +840,8 @@ eval_ordered instant at 50m sort_by_label_desc(http_requests, "instance", "group
|
||||
http_requests{group="canary", instance="0", job="app-server"} 700
|
||||
http_requests{group="canary", instance="0", job="api-server"} 300
|
||||
|
||||
eval_ordered instant at 50m sort_by_label_desc(http_requests, "instance", "group", "job")
|
||||
eval instant at 50m sort_by_label_desc(http_requests, "instance", "group", "job")
|
||||
expect ordered
|
||||
http_requests{group="production", instance="2", job="api-server"} 100
|
||||
http_requests{group="canary", instance="2", job="api-server"} NaN
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
@ -797,7 +853,8 @@ eval_ordered instant at 50m sort_by_label_desc(http_requests, "instance", "group
|
||||
http_requests{group="canary", instance="0", job="app-server"} 700
|
||||
http_requests{group="canary", instance="0", job="api-server"} 300
|
||||
|
||||
eval_ordered instant at 50m sort_by_label(cpu_time_total, "cpu")
|
||||
eval instant at 50m sort_by_label(cpu_time_total, "cpu")
|
||||
expect ordered
|
||||
cpu_time_total{job="cpu", cpu="0"} 100
|
||||
cpu_time_total{job="cpu", cpu="1"} 100
|
||||
cpu_time_total{job="cpu", cpu="2"} 100
|
||||
@ -809,12 +866,14 @@ eval_ordered instant at 50m sort_by_label(cpu_time_total, "cpu")
|
||||
cpu_time_total{job="cpu", cpu="21"} 100
|
||||
cpu_time_total{job="cpu", cpu="100"} 100
|
||||
|
||||
eval_ordered instant at 50m sort_by_label(node_uname_info, "instance")
|
||||
eval instant at 50m sort_by_label(node_uname_info, "instance")
|
||||
expect ordered
|
||||
node_uname_info{job="node_exporter", instance="4m5", release="1.11.3"} 100
|
||||
node_uname_info{job="node_exporter", instance="4m600", release="1.2.3"} 100
|
||||
node_uname_info{job="node_exporter", instance="4m1000", release="1.111.3"} 100
|
||||
|
||||
eval_ordered instant at 50m sort_by_label(node_uname_info, "release")
|
||||
eval instant at 50m sort_by_label(node_uname_info, "release")
|
||||
expect ordered
|
||||
node_uname_info{job="node_exporter", instance="4m600", release="1.2.3"} 100
|
||||
node_uname_info{job="node_exporter", instance="4m5", release="1.11.3"} 100
|
||||
node_uname_info{job="node_exporter", instance="4m1000", release="1.111.3"} 100
|
||||
@ -835,13 +894,15 @@ load 10s
|
||||
http_requests_histogram{job="api-server", instance="1", group="canary"} {{schema:0 count:1 sum:2}}x1000
|
||||
|
||||
eval instant at 8000s double_exponential_smoothing(http_requests[1m], 0.01, 0.1)
|
||||
expect no_info
|
||||
{job="api-server", instance="0", group="production"} 8000
|
||||
{job="api-server", instance="1", group="production"} 16000
|
||||
{job="api-server", instance="0", group="canary"} 24000
|
||||
{job="api-server", instance="1", group="canary"} 32000
|
||||
|
||||
# double_exponential_smoothing should ignore histograms in a mixed range of floats and histograms, flagged by an info annotation.
|
||||
eval_info instant at 20010s double_exponential_smoothing(http_requests_mix[1m], 0.01, 0.1)
|
||||
eval instant at 20010s double_exponential_smoothing(http_requests_mix[1m], 0.01, 0.1)
|
||||
expect info
|
||||
{job="api-server", instance="0", group="production"} 30100
|
||||
{job="api-server", instance="1", group="production"} 30200
|
||||
{job="api-server", instance="0", group="canary"} 80300
|
||||
@ -849,6 +910,7 @@ eval_info instant at 20010s double_exponential_smoothing(http_requests_mix[1m],
|
||||
|
||||
# double_exponential_smoothing should silently ignore ranges consisting only of histograms.
|
||||
eval instant at 10000s double_exponential_smoothing(http_requests_histogram[1m], 0.01, 0.1)
|
||||
expect no_info
|
||||
#empty
|
||||
|
||||
# negative trends
|
||||
@ -994,10 +1056,12 @@ eval instant at 55s sum_over_time(metric11[1m])/count_over_time(metric11[1m])
|
||||
{} NaN
|
||||
|
||||
# Tests for samples with mix of floats and histograms.
|
||||
eval_warn instant at 55s sum_over_time(metric12[1m])
|
||||
eval instant at 55s sum_over_time(metric12[1m])
|
||||
expect warn
|
||||
# no result.
|
||||
|
||||
eval_warn instant at 55s avg_over_time(metric12[1m])
|
||||
eval instant at 55s avg_over_time(metric12[1m])
|
||||
expect warn
|
||||
# no result.
|
||||
|
||||
# Tests for samples with only histograms.
|
||||
@ -1184,13 +1248,16 @@ eval instant at 1m stddev_over_time((metric[2m]))
|
||||
eval instant at 1m stddev_over_time(metric_histogram{type="only_histogram"}[2m])
|
||||
#empty
|
||||
|
||||
eval_info instant at 1m stddev_over_time(metric_histogram{type="mix"}[2m])
|
||||
eval instant at 1m stddev_over_time(metric_histogram{type="mix"}[2m])
|
||||
expect info
|
||||
{type="mix"} 0
|
||||
|
||||
eval instant at 1m stdvar_over_time(metric_histogram{type="only_histogram"}[2m])
|
||||
expect no_info
|
||||
#empty
|
||||
|
||||
eval_info instant at 1m stdvar_over_time(metric_histogram{type="mix"}[2m])
|
||||
eval instant at 1m stdvar_over_time(metric_histogram{type="mix"}[2m])
|
||||
expect info
|
||||
{type="mix"} 0
|
||||
|
||||
# Tests for stddev_over_time and stdvar_over_time #4927.
|
||||
@ -1212,12 +1279,15 @@ load 10s
|
||||
metric_histogram{type="mix"} 1 1 1 {{schema:1 sum:2 count:3}} {{schema:1 sum:2 count:3}}
|
||||
|
||||
eval instant at 70s mad_over_time(metric[70s])
|
||||
expect no_info
|
||||
{} 1
|
||||
|
||||
eval instant at 70s mad_over_time(metric_histogram{type="only_histogram"}[70s])
|
||||
expect no_info
|
||||
#empty
|
||||
|
||||
eval_info instant at 70s mad_over_time(metric_histogram{type="mix"}[70s])
|
||||
eval instant at 70s mad_over_time(metric_histogram{type="mix"}[70s])
|
||||
expect info
|
||||
{type="mix"} 0
|
||||
|
||||
# Tests for ts_of_max_over_time and ts_of_min_over_time. Using odd scrape interval to test for rounding bugs.
|
||||
@ -1261,49 +1331,69 @@ load 10s
|
||||
data_histogram{test="mix samples"} 0 1 2 {{schema:0 sum:1 count:2}}x2
|
||||
|
||||
eval instant at 1m quantile_over_time(0, data[2m])
|
||||
expect no_info
|
||||
expect no_warn
|
||||
{test="two samples"} 0
|
||||
{test="three samples"} 0
|
||||
{test="uneven samples"} 0
|
||||
|
||||
eval instant at 1m quantile_over_time(0.5, data[2m])
|
||||
expect no_info
|
||||
expect no_warn
|
||||
{test="two samples"} 0.5
|
||||
{test="three samples"} 1
|
||||
{test="uneven samples"} 1
|
||||
|
||||
eval instant at 1m quantile_over_time(0.75, data[2m])
|
||||
expect no_info
|
||||
expect no_warn
|
||||
{test="two samples"} 0.75
|
||||
{test="three samples"} 1.5
|
||||
{test="uneven samples"} 2.5
|
||||
|
||||
eval instant at 1m quantile_over_time(0.8, data[2m])
|
||||
expect no_info
|
||||
expect no_warn
|
||||
{test="two samples"} 0.8
|
||||
{test="three samples"} 1.6
|
||||
{test="uneven samples"} 2.8
|
||||
|
||||
eval instant at 1m quantile_over_time(1, data[2m])
|
||||
expect no_info
|
||||
expect no_warn
|
||||
{test="two samples"} 1
|
||||
{test="three samples"} 2
|
||||
{test="uneven samples"} 4
|
||||
|
||||
eval_warn instant at 1m quantile_over_time(-1, data[2m])
|
||||
eval instant at 1m quantile_over_time(-1, data[2m])
|
||||
expect no_info
|
||||
expect warn
|
||||
{test="two samples"} -Inf
|
||||
{test="three samples"} -Inf
|
||||
{test="uneven samples"} -Inf
|
||||
|
||||
eval_warn instant at 1m quantile_over_time(2, data[2m])
|
||||
eval instant at 1m quantile_over_time(2, data[2m])
|
||||
expect no_info
|
||||
expect warn
|
||||
{test="two samples"} +Inf
|
||||
{test="three samples"} +Inf
|
||||
{test="uneven samples"} +Inf
|
||||
|
||||
eval_warn instant at 1m (quantile_over_time(2, (data[2m])))
|
||||
eval instant at 1m (quantile_over_time(2, (data[2m])))
|
||||
expect no_info
|
||||
expect warn
|
||||
{test="two samples"} +Inf
|
||||
{test="three samples"} +Inf
|
||||
{test="uneven samples"} +Inf
|
||||
|
||||
eval instant at 1m quantile_over_time(0.5, data_histogram{test="only histogram samples"}[2m])
|
||||
expect no_info
|
||||
expect no_warn
|
||||
#empty
|
||||
|
||||
eval_info instant at 1m quantile_over_time(0.5, data_histogram{test="mix samples"}[2m])
|
||||
eval instant at 1m quantile_over_time(0.5, data_histogram{test="mix samples"}[2m])
|
||||
expect info
|
||||
expect no_warn
|
||||
{test="mix samples"} 1
|
||||
|
||||
clear
|
||||
@ -1417,7 +1507,8 @@ load 5m
|
||||
testmetric1{src="a",dst="b"} 0
|
||||
testmetric2{src="a",dst="b"} 1
|
||||
|
||||
eval_fail instant at 0m changes({__name__=~'testmetric1|testmetric2'}[5m])
|
||||
eval instant at 0m changes({__name__=~'testmetric1|testmetric2'}[5m])
|
||||
expect fail
|
||||
|
||||
clear
|
||||
|
||||
@ -1432,6 +1523,7 @@ load 10s
|
||||
data_histogram{type="mix_samples"} 0 1 {{schema:0 sum:1 count:2}} {{schema:0 sum:2 count:3}}
|
||||
|
||||
eval instant at 1m min_over_time(data[2m])
|
||||
expect no_info
|
||||
{type="numbers"} 0
|
||||
{type="some_nan"} 0
|
||||
{type="some_nan2"} 1
|
||||
@ -1439,12 +1531,15 @@ eval instant at 1m min_over_time(data[2m])
|
||||
{type="only_nan"} NaN
|
||||
|
||||
eval instant at 1m min_over_time(data_histogram{type="only_histogram"}[2m])
|
||||
expect no_info
|
||||
#empty
|
||||
|
||||
eval_info instant at 1m min_over_time(data_histogram{type="mix_samples"}[2m])
|
||||
eval instant at 1m min_over_time(data_histogram{type="mix_samples"}[2m])
|
||||
expect info
|
||||
{type="mix_samples"} 0
|
||||
|
||||
eval instant at 1m max_over_time(data[2m])
|
||||
expect no_info
|
||||
{type="numbers"} 3
|
||||
{type="some_nan"} 2
|
||||
{type="some_nan2"} 2
|
||||
@ -1452,12 +1547,15 @@ eval instant at 1m max_over_time(data[2m])
|
||||
{type="only_nan"} NaN
|
||||
|
||||
eval instant at 1m max_over_time(data_histogram{type="only_histogram"}[2m])
|
||||
expect no_info
|
||||
#empty
|
||||
|
||||
eval_info instant at 1m max_over_time(data_histogram{type="mix_samples"}[2m])
|
||||
eval instant at 1m max_over_time(data_histogram{type="mix_samples"}[2m])
|
||||
expect info
|
||||
{type="mix_samples"} 1
|
||||
|
||||
eval instant at 1m last_over_time({__name__=~"data(_histogram)?"}[2m])
|
||||
expect no_info
|
||||
data{type="numbers"} 3
|
||||
data{type="some_nan"} NaN
|
||||
data{type="some_nan2"} 1
|
||||
@ -1467,6 +1565,7 @@ eval instant at 1m last_over_time({__name__=~"data(_histogram)?"}[2m])
|
||||
data_histogram{type="mix_samples"} {{schema:0 sum:2 count:3}}
|
||||
|
||||
eval instant at 1m count_over_time({__name__=~"data(_histogram)?"}[2m])
|
||||
expect no_info
|
||||
{type="numbers"} 3
|
||||
{type="some_nan"} 3
|
||||
{type="some_nan2"} 3
|
||||
|
121
promql/promqltest/testdata/histograms.test
vendored
121
promql/promqltest/testdata/histograms.test
vendored
@ -70,74 +70,91 @@ load_with_nhcb 5m
|
||||
|
||||
# Test histogram_count.
|
||||
eval instant at 50m histogram_count(testhistogram3)
|
||||
expect no_warn
|
||||
{start="positive"} 110
|
||||
{start="negative"} 20
|
||||
|
||||
# Classic way of accessing the count still works.
|
||||
eval instant at 50m testhistogram3_count
|
||||
expect no_warn
|
||||
testhistogram3_count{start="positive"} 110
|
||||
testhistogram3_count{start="negative"} 20
|
||||
|
||||
# Test histogram_sum.
|
||||
eval instant at 50m histogram_sum(testhistogram3)
|
||||
expect no_warn
|
||||
{start="positive"} 330
|
||||
{start="negative"} 80
|
||||
|
||||
# Classic way of accessing the sum still works.
|
||||
eval instant at 50m testhistogram3_sum
|
||||
expect no_warn
|
||||
testhistogram3_sum{start="positive"} 330
|
||||
testhistogram3_sum{start="negative"} 80
|
||||
|
||||
# Test histogram_avg. This has no classic equivalent.
|
||||
eval instant at 50m histogram_avg(testhistogram3)
|
||||
expect no_warn
|
||||
{start="positive"} 3
|
||||
{start="negative"} 4
|
||||
|
||||
# Test histogram_stddev. This has no classic equivalent.
|
||||
eval instant at 50m histogram_stddev(testhistogram3)
|
||||
expect no_warn
|
||||
{start="positive"} 2.7435461458749795
|
||||
{start="negative"} 4.187667907081458
|
||||
|
||||
# Test histogram_stdvar. This has no classic equivalent.
|
||||
eval instant at 50m histogram_stdvar(testhistogram3)
|
||||
expect no_warn
|
||||
{start="positive"} 7.527045454545455
|
||||
{start="negative"} 17.5365625
|
||||
|
||||
# Test histogram_fraction.
|
||||
#
|
||||
eval instant at 50m histogram_fraction(0, 4, testhistogram2)
|
||||
expect no_warn
|
||||
{} 0.6666666666666666
|
||||
|
||||
eval instant at 50m histogram_fraction(0, 4, testhistogram2_bucket)
|
||||
expect no_warn
|
||||
{} 0.6666666666666666
|
||||
|
||||
eval instant at 50m histogram_fraction(0, 6, testhistogram2)
|
||||
expect no_warn
|
||||
{} 1
|
||||
|
||||
eval instant at 50m histogram_fraction(0, 6, testhistogram2_bucket)
|
||||
expect no_warn
|
||||
{} 1
|
||||
|
||||
eval instant at 50m histogram_fraction(0, 3.5, testhistogram2)
|
||||
expect no_warn
|
||||
{} 0.5833333333333334
|
||||
|
||||
eval instant at 50m histogram_fraction(0, 3.5, testhistogram2_bucket)
|
||||
expect no_warn
|
||||
{} 0.5833333333333334
|
||||
|
||||
|
||||
eval instant at 50m histogram_fraction(0, 0.2, testhistogram3)
|
||||
expect no_warn
|
||||
{start="positive"} 0.6363636363636364
|
||||
{start="negative"} 0
|
||||
|
||||
eval instant at 50m histogram_fraction(0, 0.2, testhistogram3_bucket)
|
||||
expect no_warn
|
||||
{start="positive"} 0.6363636363636364
|
||||
{start="negative"} 0
|
||||
|
||||
eval instant at 50m histogram_fraction(0, 0.2, rate(testhistogram3[10m]))
|
||||
expect no_warn
|
||||
{start="positive"} 0.6363636363636364
|
||||
{start="negative"} 0
|
||||
|
||||
|
||||
eval instant at 50m histogram_fraction(0, 0.2, rate(testhistogram3_bucket[10m]))
|
||||
expect no_warn
|
||||
{start="positive"} 0.6363636363636364
|
||||
{start="negative"} 0
|
||||
|
||||
@ -145,80 +162,98 @@ eval instant at 50m histogram_fraction(0, 0.2, rate(testhistogram3_bucket[10m]))
|
||||
# it exists) and divide by the count to get the same result.
|
||||
|
||||
eval instant at 50m testhistogram3_bucket{le=".2"} / ignoring(le) testhistogram3_count
|
||||
expect no_warn
|
||||
{start="positive"} 0.6363636363636364
|
||||
|
||||
eval instant at 50m rate(testhistogram3_bucket{le=".2"}[10m]) / ignoring(le) rate(testhistogram3_count[10m])
|
||||
expect no_warn
|
||||
{start="positive"} 0.6363636363636364
|
||||
|
||||
# Test histogram_quantile, native and classic.
|
||||
|
||||
eval instant at 50m histogram_quantile(0, testhistogram3)
|
||||
expect no_warn
|
||||
{start="positive"} 0
|
||||
{start="negative"} -0.25
|
||||
|
||||
eval instant at 50m histogram_quantile(0, testhistogram3_bucket)
|
||||
expect no_warn
|
||||
{start="positive"} 0
|
||||
{start="negative"} -0.25
|
||||
|
||||
eval instant at 50m histogram_quantile(0.25, testhistogram3)
|
||||
expect no_warn
|
||||
{start="positive"} 0.055
|
||||
{start="negative"} -0.225
|
||||
|
||||
eval instant at 50m histogram_quantile(0.25, testhistogram3_bucket)
|
||||
expect no_warn
|
||||
{start="positive"} 0.055
|
||||
{start="negative"} -0.225
|
||||
|
||||
eval instant at 50m histogram_quantile(0.5, testhistogram3)
|
||||
expect no_warn
|
||||
{start="positive"} 0.125
|
||||
{start="negative"} -0.2
|
||||
|
||||
eval instant at 50m histogram_quantile(0.5, testhistogram3_bucket)
|
||||
expect no_warn
|
||||
{start="positive"} 0.125
|
||||
{start="negative"} -0.2
|
||||
|
||||
eval instant at 50m histogram_quantile(0.75, testhistogram3)
|
||||
expect no_warn
|
||||
{start="positive"} 0.45
|
||||
{start="negative"} -0.15
|
||||
|
||||
eval instant at 50m histogram_quantile(0.75, testhistogram3_bucket)
|
||||
expect no_warn
|
||||
{start="positive"} 0.45
|
||||
{start="negative"} -0.15
|
||||
|
||||
eval instant at 50m histogram_quantile(1, testhistogram3)
|
||||
expect no_warn
|
||||
{start="positive"} 1
|
||||
{start="negative"} -0.1
|
||||
|
||||
eval instant at 50m histogram_quantile(1, testhistogram3_bucket)
|
||||
expect no_warn
|
||||
{start="positive"} 1
|
||||
{start="negative"} -0.1
|
||||
|
||||
# Quantile too low.
|
||||
|
||||
eval_warn instant at 50m histogram_quantile(-0.1, testhistogram)
|
||||
eval instant at 50m histogram_quantile(-0.1, testhistogram)
|
||||
expect warn
|
||||
{start="positive"} -Inf
|
||||
{start="negative"} -Inf
|
||||
|
||||
eval_warn instant at 50m histogram_quantile(-0.1, testhistogram_bucket)
|
||||
eval instant at 50m histogram_quantile(-0.1, testhistogram_bucket)
|
||||
expect warn
|
||||
{start="positive"} -Inf
|
||||
{start="negative"} -Inf
|
||||
|
||||
# Quantile too high.
|
||||
|
||||
eval_warn instant at 50m histogram_quantile(1.01, testhistogram)
|
||||
eval instant at 50m histogram_quantile(1.01, testhistogram)
|
||||
expect warn
|
||||
{start="positive"} +Inf
|
||||
{start="negative"} +Inf
|
||||
|
||||
eval_warn instant at 50m histogram_quantile(1.01, testhistogram_bucket)
|
||||
eval instant at 50m histogram_quantile(1.01, testhistogram_bucket)
|
||||
expect warn
|
||||
{start="positive"} +Inf
|
||||
{start="negative"} +Inf
|
||||
|
||||
# Quantile invalid.
|
||||
|
||||
eval_warn instant at 50m histogram_quantile(NaN, testhistogram)
|
||||
eval instant at 50m histogram_quantile(NaN, testhistogram)
|
||||
expect warn
|
||||
{start="positive"} NaN
|
||||
{start="negative"} NaN
|
||||
|
||||
eval_warn instant at 50m histogram_quantile(NaN, testhistogram_bucket)
|
||||
eval instant at 50m histogram_quantile(NaN, testhistogram_bucket)
|
||||
expect warn
|
||||
{start="positive"} NaN
|
||||
{start="negative"} NaN
|
||||
|
||||
@ -228,196 +263,244 @@ eval instant at 50m histogram_quantile(NaN, non_existent)
|
||||
# Quantile value in lowest bucket.
|
||||
|
||||
eval instant at 50m histogram_quantile(0, testhistogram)
|
||||
expect no_warn
|
||||
{start="positive"} 0
|
||||
{start="negative"} -0.2
|
||||
|
||||
eval instant at 50m histogram_quantile(0, testhistogram_bucket)
|
||||
expect no_warn
|
||||
{start="positive"} 0
|
||||
{start="negative"} -0.2
|
||||
|
||||
# Quantile value in highest bucket.
|
||||
|
||||
eval instant at 50m histogram_quantile(1, testhistogram)
|
||||
expect no_warn
|
||||
{start="positive"} 1
|
||||
{start="negative"} 0.3
|
||||
|
||||
eval instant at 50m histogram_quantile(1, testhistogram_bucket)
|
||||
expect no_warn
|
||||
{start="positive"} 1
|
||||
{start="negative"} 0.3
|
||||
|
||||
# Finally some useful quantiles.
|
||||
|
||||
eval instant at 50m histogram_quantile(0.2, testhistogram)
|
||||
expect no_warn
|
||||
{start="positive"} 0.048
|
||||
{start="negative"} -0.2
|
||||
|
||||
eval instant at 50m histogram_quantile(0.2, testhistogram_bucket)
|
||||
expect no_warn
|
||||
{start="positive"} 0.048
|
||||
{start="negative"} -0.2
|
||||
|
||||
eval instant at 50m histogram_quantile(0.5, testhistogram)
|
||||
expect no_warn
|
||||
{start="positive"} 0.15
|
||||
{start="negative"} -0.15
|
||||
|
||||
eval instant at 50m histogram_quantile(0.5, testhistogram_bucket)
|
||||
expect no_warn
|
||||
{start="positive"} 0.15
|
||||
{start="negative"} -0.15
|
||||
|
||||
eval instant at 50m histogram_quantile(0.8, testhistogram)
|
||||
expect no_warn
|
||||
{start="positive"} 0.72
|
||||
{start="negative"} 0.3
|
||||
|
||||
eval instant at 50m histogram_quantile(0.8, testhistogram_bucket)
|
||||
expect no_warn
|
||||
{start="positive"} 0.72
|
||||
{start="negative"} 0.3
|
||||
|
||||
# More realistic with rates.
|
||||
eval instant at 50m histogram_quantile(0.2, rate(testhistogram[10m]))
|
||||
expect no_warn
|
||||
{start="positive"} 0.048
|
||||
{start="negative"} -0.2
|
||||
|
||||
eval instant at 50m histogram_quantile(0.2, rate(testhistogram_bucket[10m]))
|
||||
expect no_warn
|
||||
{start="positive"} 0.048
|
||||
{start="negative"} -0.2
|
||||
|
||||
eval instant at 50m histogram_quantile(0.5, rate(testhistogram[10m]))
|
||||
expect no_warn
|
||||
{start="positive"} 0.15
|
||||
{start="negative"} -0.15
|
||||
|
||||
eval instant at 50m histogram_quantile(0.5, rate(testhistogram_bucket[10m]))
|
||||
expect no_warn
|
||||
{start="positive"} 0.15
|
||||
{start="negative"} -0.15
|
||||
|
||||
eval instant at 50m histogram_quantile(0.8, rate(testhistogram[10m]))
|
||||
expect no_warn
|
||||
{start="positive"} 0.72
|
||||
{start="negative"} 0.3
|
||||
|
||||
eval instant at 50m histogram_quantile(0.8, rate(testhistogram_bucket[10m]))
|
||||
expect no_warn
|
||||
{start="positive"} 0.72
|
||||
{start="negative"} 0.3
|
||||
|
||||
# Want results exactly in the middle of the bucket.
|
||||
|
||||
eval instant at 7m histogram_quantile(1./6., testhistogram2)
|
||||
expect no_warn
|
||||
{} 1
|
||||
|
||||
eval instant at 7m histogram_quantile(1./6., testhistogram2_bucket)
|
||||
expect no_warn
|
||||
{} 1
|
||||
|
||||
eval instant at 7m histogram_quantile(0.5, testhistogram2)
|
||||
expect no_warn
|
||||
{} 3
|
||||
|
||||
eval instant at 7m histogram_quantile(0.5, testhistogram2_bucket)
|
||||
expect no_warn
|
||||
{} 3
|
||||
|
||||
eval instant at 7m histogram_quantile(5./6., testhistogram2)
|
||||
expect no_warn
|
||||
{} 5
|
||||
|
||||
eval instant at 7m histogram_quantile(5./6., testhistogram2_bucket)
|
||||
expect no_warn
|
||||
{} 5
|
||||
|
||||
eval instant at 47m histogram_quantile(1./6., rate(testhistogram2[15m]))
|
||||
expect no_warn
|
||||
{} 1
|
||||
|
||||
eval instant at 47m histogram_quantile(1./6., rate(testhistogram2_bucket[15m]))
|
||||
expect no_warn
|
||||
{} 1
|
||||
|
||||
eval instant at 47m histogram_quantile(0.5, rate(testhistogram2[15m]))
|
||||
expect no_warn
|
||||
{} 3
|
||||
|
||||
eval instant at 47m histogram_quantile(0.5, rate(testhistogram2_bucket[15m]))
|
||||
expect no_warn
|
||||
{} 3
|
||||
|
||||
eval instant at 47m histogram_quantile(5./6., rate(testhistogram2[15m]))
|
||||
expect no_warn
|
||||
{} 5
|
||||
|
||||
eval instant at 47m histogram_quantile(5./6., rate(testhistogram2_bucket[15m]))
|
||||
expect no_warn
|
||||
{} 5
|
||||
|
||||
# Aggregated histogram: Everything in one. Note how native histograms
|
||||
# don't require aggregation by le.
|
||||
|
||||
eval instant at 50m histogram_quantile(0.3, sum(rate(request_duration_seconds[10m])))
|
||||
expect no_warn
|
||||
{} 0.075
|
||||
|
||||
eval instant at 50m histogram_quantile(0.3, sum(rate(request_duration_seconds_bucket[10m])) by (le))
|
||||
expect no_warn
|
||||
{} 0.075
|
||||
|
||||
eval instant at 50m histogram_quantile(0.5, sum(rate(request_duration_seconds[10m])))
|
||||
expect no_warn
|
||||
{} 0.1277777777777778
|
||||
|
||||
eval instant at 50m histogram_quantile(0.5, sum(rate(request_duration_seconds_bucket[10m])) by (le))
|
||||
expect no_warn
|
||||
{} 0.1277777777777778
|
||||
|
||||
# Aggregated histogram: Everything in one. Now with avg, which does not change anything.
|
||||
|
||||
eval instant at 50m histogram_quantile(0.3, avg(rate(request_duration_seconds[10m])))
|
||||
expect no_warn
|
||||
{} 0.075
|
||||
|
||||
eval instant at 50m histogram_quantile(0.3, avg(rate(request_duration_seconds_bucket[10m])) by (le))
|
||||
expect no_warn
|
||||
{} 0.075
|
||||
|
||||
eval instant at 50m histogram_quantile(0.5, avg(rate(request_duration_seconds[10m])))
|
||||
expect no_warn
|
||||
{} 0.12777777777777778
|
||||
|
||||
eval instant at 50m histogram_quantile(0.5, avg(rate(request_duration_seconds_bucket[10m])) by (le))
|
||||
expect no_warn
|
||||
{} 0.12777777777777778
|
||||
|
||||
# Aggregated histogram: By instance.
|
||||
|
||||
eval instant at 50m histogram_quantile(0.3, sum(rate(request_duration_seconds[10m])) by (instance))
|
||||
expect no_warn
|
||||
{instance="ins1"} 0.075
|
||||
{instance="ins2"} 0.075
|
||||
|
||||
eval instant at 50m histogram_quantile(0.3, sum(rate(request_duration_seconds_bucket[10m])) by (le, instance))
|
||||
expect no_warn
|
||||
{instance="ins1"} 0.075
|
||||
{instance="ins2"} 0.075
|
||||
|
||||
eval instant at 50m histogram_quantile(0.5, sum(rate(request_duration_seconds[10m])) by (instance))
|
||||
expect no_warn
|
||||
{instance="ins1"} 0.1333333333
|
||||
{instance="ins2"} 0.125
|
||||
|
||||
eval instant at 50m histogram_quantile(0.5, sum(rate(request_duration_seconds_bucket[10m])) by (le, instance))
|
||||
expect no_warn
|
||||
{instance="ins1"} 0.1333333333
|
||||
{instance="ins2"} 0.125
|
||||
|
||||
# Aggregated histogram: By job.
|
||||
eval instant at 50m histogram_quantile(0.3, sum(rate(request_duration_seconds[10m])) by (job))
|
||||
expect no_warn
|
||||
{job="job1"} 0.1
|
||||
{job="job2"} 0.0642857142857143
|
||||
|
||||
eval instant at 50m histogram_quantile(0.3, sum(rate(request_duration_seconds_bucket[10m])) by (le, job))
|
||||
expect no_warn
|
||||
{job="job1"} 0.1
|
||||
{job="job2"} 0.0642857142857143
|
||||
|
||||
eval instant at 50m histogram_quantile(0.5, sum(rate(request_duration_seconds[10m])) by (job))
|
||||
expect no_warn
|
||||
{job="job1"} 0.14
|
||||
{job="job2"} 0.1125
|
||||
|
||||
eval instant at 50m histogram_quantile(0.5, sum(rate(request_duration_seconds_bucket[10m])) by (le, job))
|
||||
expect no_warn
|
||||
{job="job1"} 0.14
|
||||
{job="job2"} 0.1125
|
||||
|
||||
# Aggregated histogram: By job and instance.
|
||||
eval instant at 50m histogram_quantile(0.3, sum(rate(request_duration_seconds[10m])) by (job, instance))
|
||||
expect no_warn
|
||||
{instance="ins1", job="job1"} 0.11
|
||||
{instance="ins2", job="job1"} 0.09
|
||||
{instance="ins1", job="job2"} 0.06
|
||||
{instance="ins2", job="job2"} 0.0675
|
||||
|
||||
eval instant at 50m histogram_quantile(0.3, sum(rate(request_duration_seconds_bucket[10m])) by (le, job, instance))
|
||||
expect no_warn
|
||||
{instance="ins1", job="job1"} 0.11
|
||||
{instance="ins2", job="job1"} 0.09
|
||||
{instance="ins1", job="job2"} 0.06
|
||||
{instance="ins2", job="job2"} 0.0675
|
||||
|
||||
eval instant at 50m histogram_quantile(0.5, sum(rate(request_duration_seconds[10m])) by (job, instance))
|
||||
expect no_warn
|
||||
{instance="ins1", job="job1"} 0.15
|
||||
{instance="ins2", job="job1"} 0.1333333333333333
|
||||
{instance="ins1", job="job2"} 0.1
|
||||
{instance="ins2", job="job2"} 0.1166666666666667
|
||||
|
||||
eval instant at 50m histogram_quantile(0.5, sum(rate(request_duration_seconds_bucket[10m])) by (le, job, instance))
|
||||
expect no_warn
|
||||
{instance="ins1", job="job1"} 0.15
|
||||
{instance="ins2", job="job1"} 0.1333333333333333
|
||||
{instance="ins1", job="job2"} 0.1
|
||||
@ -425,24 +508,28 @@ eval instant at 50m histogram_quantile(0.5, sum(rate(request_duration_seconds_bu
|
||||
|
||||
# The unaggregated histogram for comparison. Same result as the previous one.
|
||||
eval instant at 50m histogram_quantile(0.3, rate(request_duration_seconds[10m]))
|
||||
expect no_warn
|
||||
{instance="ins1", job="job1"} 0.11
|
||||
{instance="ins2", job="job1"} 0.09
|
||||
{instance="ins1", job="job2"} 0.06
|
||||
{instance="ins2", job="job2"} 0.0675
|
||||
|
||||
eval instant at 50m histogram_quantile(0.3, rate(request_duration_seconds_bucket[10m]))
|
||||
expect no_warn
|
||||
{instance="ins1", job="job1"} 0.11
|
||||
{instance="ins2", job="job1"} 0.09
|
||||
{instance="ins1", job="job2"} 0.06
|
||||
{instance="ins2", job="job2"} 0.0675
|
||||
|
||||
eval instant at 50m histogram_quantile(0.5, rate(request_duration_seconds[10m]))
|
||||
expect no_warn
|
||||
{instance="ins1", job="job1"} 0.15
|
||||
{instance="ins2", job="job1"} 0.13333333333333333
|
||||
{instance="ins1", job="job2"} 0.1
|
||||
{instance="ins2", job="job2"} 0.11666666666666667
|
||||
|
||||
eval instant at 50m histogram_quantile(0.5, rate(request_duration_seconds_bucket[10m]))
|
||||
expect no_warn
|
||||
{instance="ins1", job="job1"} 0.15
|
||||
{instance="ins2", job="job1"} 0.13333333333333333
|
||||
{instance="ins1", job="job2"} 0.1
|
||||
@ -450,25 +537,32 @@ eval instant at 50m histogram_quantile(0.5, rate(request_duration_seconds_bucket
|
||||
|
||||
# All NHCBs summed into one.
|
||||
eval instant at 50m sum(request_duration_seconds)
|
||||
expect no_warn
|
||||
{} {{schema:-53 count:250 custom_values:[0.1 0.2] buckets:[100 90 60]}}
|
||||
|
||||
eval instant at 50m sum(request_duration_seconds{job="job1",instance="ins1"} + ignoring(job,instance) request_duration_seconds{job="job1",instance="ins2"} + ignoring(job,instance) request_duration_seconds{job="job2",instance="ins1"} + ignoring(job,instance) request_duration_seconds{job="job2",instance="ins2"})
|
||||
expect no_warn
|
||||
{} {{schema:-53 count:250 custom_values:[0.1 0.2] buckets:[100 90 60]}}
|
||||
|
||||
eval instant at 50m avg(request_duration_seconds)
|
||||
expect no_warn
|
||||
{} {{schema:-53 count:62.5 custom_values:[0.1 0.2] buckets:[25 22.5 15]}}
|
||||
|
||||
# To verify the result above, calculate from classic histogram as well.
|
||||
eval instant at 50m avg (request_duration_seconds_bucket{le="0.1"})
|
||||
expect no_warn
|
||||
{} 25
|
||||
|
||||
eval instant at 50m avg (request_duration_seconds_bucket{le="0.2"}) - avg (request_duration_seconds_bucket{le="0.1"})
|
||||
expect no_warn
|
||||
{} 22.5
|
||||
|
||||
eval instant at 50m avg (request_duration_seconds_bucket{le="+Inf"}) - avg (request_duration_seconds_bucket{le="0.2"})
|
||||
expect no_warn
|
||||
{} 15
|
||||
|
||||
eval instant at 50m count(request_duration_seconds)
|
||||
expect no_warn
|
||||
{} 4
|
||||
|
||||
# A histogram with nonmonotonic bucket counts. This may happen when recording
|
||||
@ -484,13 +578,16 @@ load 5m
|
||||
nonmonotonic_bucket{le="+Inf"} 0+8x10
|
||||
|
||||
# Nonmonotonic buckets, triggering an info annotation.
|
||||
eval_info instant at 50m histogram_quantile(0.01, nonmonotonic_bucket)
|
||||
eval instant at 50m histogram_quantile(0.01, nonmonotonic_bucket)
|
||||
expect info
|
||||
{} 0.0045
|
||||
|
||||
eval_info instant at 50m histogram_quantile(0.5, nonmonotonic_bucket)
|
||||
eval instant at 50m histogram_quantile(0.5, nonmonotonic_bucket)
|
||||
expect info
|
||||
{} 8.5
|
||||
|
||||
eval_info instant at 50m histogram_quantile(0.99, nonmonotonic_bucket)
|
||||
eval instant at 50m histogram_quantile(0.99, nonmonotonic_bucket)
|
||||
expect info
|
||||
{} 979.75
|
||||
|
||||
# Buckets with different representations of the same upper bound.
|
||||
@ -525,9 +622,11 @@ load_with_nhcb 5m
|
||||
request_duration_seconds2_bucket{job="job1", instance="ins1", le="0.2"} 0+3x10
|
||||
request_duration_seconds2_bucket{job="job1", instance="ins1", le="+Inf"} 0+4x10
|
||||
|
||||
eval_fail instant at 50m histogram_quantile(0.99, {__name__=~"request_duration_seconds\\d*_bucket"})
|
||||
eval instant at 50m histogram_quantile(0.99, {__name__=~"request_duration_seconds\\d*_bucket"})
|
||||
expect fail
|
||||
|
||||
eval_fail instant at 50m histogram_quantile(0.99, {__name__=~"request_duration_seconds\\d*"})
|
||||
eval instant at 50m histogram_quantile(0.99, {__name__=~"request_duration_seconds\\d*"})
|
||||
expect fail
|
||||
|
||||
# Histogram with constant buckets.
|
||||
load_with_nhcb 1m
|
||||
|
8
promql/promqltest/testdata/limit.test
vendored
8
promql/promqltest/testdata/limit.test
vendored
@ -15,10 +15,14 @@ load 5m
|
||||
bar 0 1 0 -1 0 1 0 -1 0 1 0
|
||||
|
||||
eval instant at 50m count(limitk by (group) (0, http_requests))
|
||||
# empty
|
||||
expect no_info
|
||||
expect no_warn
|
||||
# empty
|
||||
|
||||
eval instant at 50m count(limitk by (group) (-1, http_requests))
|
||||
# empty
|
||||
expect no_info
|
||||
expect no_warn
|
||||
# empty
|
||||
|
||||
# Exercise k==1 special case (as sample is added before the main series loop).
|
||||
eval instant at 50m count(limitk by (group) (1, http_requests) and http_requests)
|
||||
|
@ -73,7 +73,8 @@ eval instant at 10m sum by (__name__, env) (metric_total{env="1"})
|
||||
|
||||
# Aggregation operators by __name__ lead to duplicate labelset errors (aggregation is partitioned by not yet removed __name__ label).
|
||||
# This is an accidental side effect of delayed __name__ label dropping
|
||||
eval_fail instant at 10m sum by (__name__) (rate({env="1"}[10m]))
|
||||
eval instant at 10m sum by (__name__) (rate({env="1"}[10m]))
|
||||
expect fail
|
||||
|
||||
# Aggregation operators aggregate metrics with same labelset and to-be-dropped names.
|
||||
# This is an accidental side effect of delayed __name__ label dropping
|
||||
|
192
promql/promqltest/testdata/native_histograms.test
vendored
192
promql/promqltest/testdata/native_histograms.test
vendored
@ -398,35 +398,44 @@ clear
|
||||
load 10m
|
||||
histogram_quantile_1 {{schema:0 count:12 sum:100 z_bucket:2 z_bucket_w:0.001 buckets:[2 3 0 1 4]}}x1
|
||||
|
||||
eval_warn instant at 10m histogram_quantile(1.001, histogram_quantile_1)
|
||||
eval instant at 10m histogram_quantile(1.001, histogram_quantile_1)
|
||||
expect warn
|
||||
{} Inf
|
||||
|
||||
eval instant at 10m histogram_quantile(1, histogram_quantile_1)
|
||||
expect no_warn
|
||||
{} 16
|
||||
|
||||
# The following quantiles are within a bucket. Exponential
|
||||
# interpolation is applied (rather than linear, as it is done for
|
||||
# classic histograms), leading to slightly different quantile values.
|
||||
eval instant at 10m histogram_quantile(0.99, histogram_quantile_1)
|
||||
expect no_warn
|
||||
{} 15.67072476139083
|
||||
|
||||
eval instant at 10m histogram_quantile(0.9, histogram_quantile_1)
|
||||
expect no_warn
|
||||
{} 12.99603834169977
|
||||
|
||||
eval instant at 10m histogram_quantile(0.6, histogram_quantile_1)
|
||||
expect no_warn
|
||||
{} 4.594793419988138
|
||||
|
||||
eval instant at 10m histogram_quantile(0.5, histogram_quantile_1)
|
||||
expect no_warn
|
||||
{} 1.5874010519681994
|
||||
|
||||
# Linear interpolation within the zero bucket after all.
|
||||
eval instant at 10m histogram_quantile(0.1, histogram_quantile_1)
|
||||
expect no_warn
|
||||
{} 0.0006
|
||||
|
||||
eval instant at 10m histogram_quantile(0, histogram_quantile_1)
|
||||
expect no_warn
|
||||
{} 0
|
||||
|
||||
eval_warn instant at 10m histogram_quantile(-1, histogram_quantile_1)
|
||||
eval instant at 10m histogram_quantile(-1, histogram_quantile_1)
|
||||
expect warn
|
||||
{} -Inf
|
||||
|
||||
clear
|
||||
@ -435,31 +444,39 @@ clear
|
||||
load 10m
|
||||
histogram_quantile_2 {{schema:0 count:12 sum:100 z_bucket:2 z_bucket_w:0.001 n_buckets:[2 3 0 1 4]}}x1
|
||||
|
||||
eval_warn instant at 10m histogram_quantile(1.001, histogram_quantile_2)
|
||||
eval instant at 10m histogram_quantile(1.001, histogram_quantile_2)
|
||||
expect warn
|
||||
{} Inf
|
||||
|
||||
eval instant at 10m histogram_quantile(1, histogram_quantile_2)
|
||||
expect no_warn
|
||||
{} 0
|
||||
|
||||
# Again, the quantile values here are slightly different from what
|
||||
# they would be with linear interpolation. Note that quantiles
|
||||
# ending up in the zero bucket are linearly interpolated after all.
|
||||
eval instant at 10m histogram_quantile(0.99, histogram_quantile_2)
|
||||
expect no_warn
|
||||
{} -0.00006
|
||||
|
||||
eval instant at 10m histogram_quantile(0.9, histogram_quantile_2)
|
||||
expect no_warn
|
||||
{} -0.0006
|
||||
|
||||
eval instant at 10m histogram_quantile(0.5, histogram_quantile_2)
|
||||
expect no_warn
|
||||
{} -1.5874010519681996
|
||||
|
||||
eval instant at 10m histogram_quantile(0.1, histogram_quantile_2)
|
||||
expect no_warn
|
||||
{} -12.996038341699768
|
||||
|
||||
eval instant at 10m histogram_quantile(0, histogram_quantile_2)
|
||||
expect no_warn
|
||||
{} -16
|
||||
|
||||
eval_warn instant at 10m histogram_quantile(-1, histogram_quantile_2)
|
||||
eval instant at 10m histogram_quantile(-1, histogram_quantile_2)
|
||||
expect warn
|
||||
{} -Inf
|
||||
|
||||
clear
|
||||
@ -470,46 +487,59 @@ clear
|
||||
load 10m
|
||||
histogram_quantile_3 {{schema:0 count:24 sum:100 z_bucket:4 z_bucket_w:0.001 buckets:[2 3 0 1 4] n_buckets:[2 3 0 1 4]}}x1
|
||||
|
||||
eval_warn instant at 10m histogram_quantile(1.001, histogram_quantile_3)
|
||||
eval instant at 10m histogram_quantile(1.001, histogram_quantile_3)
|
||||
expect warn
|
||||
{} Inf
|
||||
|
||||
eval instant at 10m histogram_quantile(1, histogram_quantile_3)
|
||||
expect no_warn
|
||||
{} 16
|
||||
|
||||
eval instant at 10m histogram_quantile(0.99, histogram_quantile_3)
|
||||
expect no_warn
|
||||
{} 15.34822590920423
|
||||
|
||||
eval instant at 10m histogram_quantile(0.9, histogram_quantile_3)
|
||||
expect no_warn
|
||||
{} 10.556063286183155
|
||||
|
||||
eval instant at 10m histogram_quantile(0.7, histogram_quantile_3)
|
||||
expect no_warn
|
||||
{} 1.2030250360821164
|
||||
|
||||
# Linear interpolation in the zero bucket, symmetrically centered around
|
||||
# the zero point.
|
||||
eval instant at 10m histogram_quantile(0.55, histogram_quantile_3)
|
||||
expect no_warn
|
||||
{} 0.0006
|
||||
|
||||
eval instant at 10m histogram_quantile(0.5, histogram_quantile_3)
|
||||
expect no_warn
|
||||
{} 0
|
||||
|
||||
eval instant at 10m histogram_quantile(0.45, histogram_quantile_3)
|
||||
expect no_warn
|
||||
{} -0.0006
|
||||
|
||||
# Finally negative buckets with mirrored exponential interpolation.
|
||||
eval instant at 10m histogram_quantile(0.3, histogram_quantile_3)
|
||||
expect no_warn
|
||||
{} -1.2030250360821169
|
||||
|
||||
eval instant at 10m histogram_quantile(0.1, histogram_quantile_3)
|
||||
expect no_warn
|
||||
{} -10.556063286183155
|
||||
|
||||
eval instant at 10m histogram_quantile(0.01, histogram_quantile_3)
|
||||
expect no_warn
|
||||
{} -15.34822590920423
|
||||
|
||||
eval instant at 10m histogram_quantile(0, histogram_quantile_3)
|
||||
expect no_warn
|
||||
{} -16
|
||||
|
||||
eval_warn instant at 10m histogram_quantile(-1, histogram_quantile_3)
|
||||
eval instant at 10m histogram_quantile(-1, histogram_quantile_3)
|
||||
expect warn
|
||||
{} -Inf
|
||||
|
||||
clear
|
||||
@ -909,63 +939,84 @@ load 10m
|
||||
float_series_0 0+0x1
|
||||
|
||||
eval instant at 10m histogram_mul_div*3
|
||||
expect no_info
|
||||
{} {{schema:0 count:90 sum:99 z_bucket:9 z_bucket_w:0.001 buckets:[9 9 9] n_buckets:[18 18 18]}}
|
||||
|
||||
eval instant at 10m histogram_mul_div*-1
|
||||
expect no_info
|
||||
{} {{schema:0 count:-30 sum:-33 z_bucket:-3 z_bucket_w:0.001 buckets:[-3 -3 -3] n_buckets:[-6 -6 -6]}}
|
||||
|
||||
eval instant at 10m -histogram_mul_div
|
||||
expect no_info
|
||||
{} {{schema:0 count:-30 sum:-33 z_bucket:-3 z_bucket_w:0.001 buckets:[-3 -3 -3] n_buckets:[-6 -6 -6]}}
|
||||
|
||||
eval instant at 10m histogram_mul_div*-3
|
||||
expect no_info
|
||||
{} {{schema:0 count:-90 sum:-99 z_bucket:-9 z_bucket_w:0.001 buckets:[-9 -9 -9] n_buckets:[-18 -18 -18]}}
|
||||
|
||||
eval instant at 10m 3*histogram_mul_div
|
||||
expect no_info
|
||||
{} {{schema:0 count:90 sum:99 z_bucket:9 z_bucket_w:0.001 buckets:[9 9 9] n_buckets:[18 18 18]}}
|
||||
|
||||
eval instant at 10m histogram_mul_div*float_series_3
|
||||
expect no_info
|
||||
{} {{schema:0 count:90 sum:99 z_bucket:9 z_bucket_w:0.001 buckets:[9 9 9] n_buckets:[18 18 18]}}
|
||||
|
||||
eval instant at 10m float_series_3*histogram_mul_div
|
||||
expect no_info
|
||||
{} {{schema:0 count:90 sum:99 z_bucket:9 z_bucket_w:0.001 buckets:[9 9 9] n_buckets:[18 18 18]}}
|
||||
|
||||
eval instant at 10m histogram_mul_div/3
|
||||
expect no_info
|
||||
{} {{schema:0 count:10 sum:11 z_bucket:1 z_bucket_w:0.001 buckets:[1 1 1] n_buckets:[2 2 2]}}
|
||||
|
||||
eval instant at 10m histogram_mul_div/-3
|
||||
expect no_info
|
||||
{} {{schema:0 count:-10 sum:-11 z_bucket:-1 z_bucket_w:0.001 buckets:[-1 -1 -1] n_buckets:[-2 -2 -2]}}
|
||||
|
||||
eval instant at 10m histogram_mul_div/float_series_3
|
||||
expect no_info
|
||||
{} {{schema:0 count:10 sum:11 z_bucket:1 z_bucket_w:0.001 buckets:[1 1 1] n_buckets:[2 2 2]}}
|
||||
|
||||
eval instant at 10m histogram_mul_div*0
|
||||
expect no_info
|
||||
{} {{schema:0 count:0 sum:0 z_bucket:0 z_bucket_w:0.001 buckets:[0 0 0] n_buckets:[0 0 0]}}
|
||||
|
||||
eval instant at 10m 0*histogram_mul_div
|
||||
expect no_info
|
||||
{} {{schema:0 count:0 sum:0 z_bucket:0 z_bucket_w:0.001 buckets:[0 0 0] n_buckets:[0 0 0]}}
|
||||
|
||||
eval instant at 10m histogram_mul_div*float_series_0
|
||||
expect no_info
|
||||
{} {{schema:0 count:0 sum:0 z_bucket:0 z_bucket_w:0.001 buckets:[0 0 0] n_buckets:[0 0 0]}}
|
||||
|
||||
eval instant at 10m float_series_0*histogram_mul_div
|
||||
expect no_info
|
||||
{} {{schema:0 count:0 sum:0 z_bucket:0 z_bucket_w:0.001 buckets:[0 0 0] n_buckets:[0 0 0]}}
|
||||
|
||||
eval instant at 10m histogram_mul_div/0
|
||||
expect no_info
|
||||
{} {{schema:0 count:Inf sum:Inf z_bucket_w:0.001 z_bucket:Inf}}
|
||||
|
||||
eval instant at 10m histogram_mul_div/float_series_0
|
||||
expect no_info
|
||||
{} {{schema:0 count:Inf sum:Inf z_bucket_w:0.001 z_bucket:Inf}}
|
||||
|
||||
eval instant at 10m histogram_mul_div*0/0
|
||||
expect no_info
|
||||
{} {{schema:0 count:NaN sum:NaN z_bucket_w:0.001 z_bucket:NaN}}
|
||||
|
||||
eval_info instant at 10m histogram_mul_div*histogram_mul_div
|
||||
eval instant at 10m histogram_mul_div*histogram_mul_div
|
||||
expect info
|
||||
|
||||
eval_info instant at 10m histogram_mul_div/histogram_mul_div
|
||||
eval instant at 10m histogram_mul_div/histogram_mul_div
|
||||
expect info
|
||||
|
||||
eval_info instant at 10m float_series_3/histogram_mul_div
|
||||
eval instant at 10m float_series_3/histogram_mul_div
|
||||
expect info
|
||||
|
||||
eval_info instant at 10m 0/histogram_mul_div
|
||||
eval instant at 10m 0/histogram_mul_div
|
||||
expect info
|
||||
|
||||
clear
|
||||
|
||||
@ -976,13 +1027,17 @@ load 10m
|
||||
histogram_sample {{schema:0 count:24 sum:100 z_bucket:4 z_bucket_w:0.001 buckets:[2 3 0 1 4] n_buckets:[2 3 0 1 4]}}x1
|
||||
float_sample 0x1
|
||||
|
||||
eval_info instant at 10m float_sample+histogram_sample
|
||||
eval instant at 10m float_sample+histogram_sample
|
||||
expect info
|
||||
|
||||
eval_info instant at 10m histogram_sample+float_sample
|
||||
eval instant at 10m histogram_sample+float_sample
|
||||
expect info
|
||||
|
||||
eval_info instant at 10m float_sample-histogram_sample
|
||||
eval instant at 10m float_sample-histogram_sample
|
||||
expect info
|
||||
|
||||
eval_info instant at 10m histogram_sample-float_sample
|
||||
eval instant at 10m histogram_sample-float_sample
|
||||
expect info
|
||||
|
||||
# Counter reset only noticeable in a single bucket.
|
||||
load 5m
|
||||
@ -1020,11 +1075,13 @@ load 30s
|
||||
some_metric {{schema:0 sum:1 count:1 buckets:[1] counter_reset_hint:gauge}} {{schema:0 sum:2 count:2 buckets:[2] counter_reset_hint:gauge}} {{schema:0 sum:3 count:3 buckets:[3] counter_reset_hint:gauge}}
|
||||
|
||||
# Test the case where we only have two points for rate
|
||||
eval_warn instant at 30s rate(some_metric[1m])
|
||||
eval instant at 30s rate(some_metric[1m])
|
||||
expect warn
|
||||
{} {{count:0.03333333333333333 sum:0.03333333333333333 buckets:[0.03333333333333333]}}
|
||||
|
||||
# Test the case where we have more than two points for rate
|
||||
eval_warn instant at 1m rate(some_metric[1m30s])
|
||||
eval instant at 1m rate(some_metric[1m30s])
|
||||
expect warn
|
||||
{} {{count:0.03333333333333333 sum:0.03333333333333333 buckets:[0.03333333333333333]}}
|
||||
|
||||
clear
|
||||
@ -1034,11 +1091,13 @@ load 30s
|
||||
some_metric {{schema:0 sum:1 count:1 buckets:[1]}} {{schema:-53 sum:1 count:1 custom_values:[5 10] buckets:[1]}} {{schema:0 sum:5 count:4 buckets:[1 2 1]}} {{schema:-53 sum:1 count:1 custom_values:[5 10] buckets:[1]}}
|
||||
|
||||
# Start and end with exponential, with custom in the middle.
|
||||
eval_warn instant at 1m rate(some_metric[1m30s])
|
||||
eval instant at 1m rate(some_metric[1m30s])
|
||||
expect warn
|
||||
# Should produce no results.
|
||||
|
||||
# Start and end with custom, with exponential in the middle.
|
||||
eval_warn instant at 1m30s rate(some_metric[1m30s])
|
||||
eval instant at 1m30s rate(some_metric[1m30s])
|
||||
expect warn
|
||||
# Should produce no results.
|
||||
|
||||
# Start with custom, end with exponential. Return the exponential histogram divided by 48.
|
||||
@ -1111,10 +1170,12 @@ load 6m
|
||||
# T=0: only exponential
|
||||
# T=6: only custom
|
||||
# T=12: mixed, should be ignored and emit a warning
|
||||
eval_warn range from 0 to 12m step 6m sum(metric)
|
||||
eval range from 0 to 12m step 6m sum(metric)
|
||||
expect warn
|
||||
{} {{sum:7 count:5 buckets:[2 3 2]}} {{schema:-53 sum:16 count:3 custom_values:[5 10] buckets:[1 2]}} _
|
||||
|
||||
eval_warn range from 0 to 12m step 6m avg(metric)
|
||||
eval range from 0 to 12m step 6m avg(metric)
|
||||
expect warn
|
||||
{} {{sum:3.5 count:2.5 buckets:[1 1.5 1]}} {{schema:-53 sum:8 count:1.5 custom_values:[5 10] buckets:[0.5 1]}} _
|
||||
|
||||
clear
|
||||
@ -1128,10 +1189,12 @@ load 6m
|
||||
# T=0: incompatible, should be ignored and emit a warning
|
||||
# T=6: compatible
|
||||
# T=12: incompatible followed by compatible, should be ignored and emit a warning
|
||||
eval_warn range from 0 to 12m step 6m sum(metric)
|
||||
eval range from 0 to 12m step 6m sum(metric)
|
||||
expect warn
|
||||
{} _ {{schema:-53 sum:2 count:2 custom_values:[5 10] buckets:[2]}} _
|
||||
|
||||
eval_warn range from 0 to 12m step 6m avg(metric)
|
||||
eval range from 0 to 12m step 6m avg(metric)
|
||||
expect warn
|
||||
{} _ {{schema:-53 sum:1 count:1 custom_values:[5 10] buckets:[1]}} _
|
||||
|
||||
# Test incompatible schemas with additional aggregation operators
|
||||
@ -1163,9 +1226,11 @@ eval range from 0 to 12m step 6m metric{series="1"} or ignoring(series) metric{s
|
||||
metric{series="2"} {{schema:-53 sum:1 count:1 custom_values:[2] buckets:[1]}} _ _
|
||||
|
||||
# Test incompatible schemas with arithmetic binary operators
|
||||
eval_warn range from 0 to 12m step 6m metric{series="2"} + ignoring (series) metric{series="3"}
|
||||
eval range from 0 to 12m step 6m metric{series="2"} + ignoring (series) metric{series="3"}
|
||||
expect warn
|
||||
|
||||
eval_warn range from 0 to 12m step 6m metric{series="2"} - ignoring (series) metric{series="3"}
|
||||
eval range from 0 to 12m step 6m metric{series="2"} - ignoring (series) metric{series="3"}
|
||||
expect warn
|
||||
|
||||
clear
|
||||
|
||||
@ -1175,12 +1240,15 @@ load 6m
|
||||
metric2 {{schema:-53 sum:1 count:1 custom_values:[5 10] buckets:[1]}} {{schema:-53 sum:1 count:1 custom_values:[5 10] buckets:[1]}}
|
||||
|
||||
eval range from 0 to 6m step 6m metric1 == metric2
|
||||
metric1{} _ {{schema:-53 count:1 sum:1 custom_values:[5 10] buckets:[1]}}
|
||||
expect no_info
|
||||
metric1{} _ {{schema:-53 count:1 sum:1 custom_values:[5 10] buckets:[1]}}
|
||||
|
||||
eval range from 0 to 6m step 6m metric1 != metric2
|
||||
metric1{} {{schema:-53 sum:1 count:1 custom_values:[2] buckets:[1]}} _
|
||||
expect no_info
|
||||
metric1{} {{schema:-53 sum:1 count:1 custom_values:[2] buckets:[1]}} _
|
||||
|
||||
eval_info range from 0 to 6m step 6m metric2 > metric2
|
||||
eval range from 0 to 6m step 6m metric2 > metric2
|
||||
expect info
|
||||
|
||||
clear
|
||||
|
||||
@ -1190,62 +1258,82 @@ load 6m
|
||||
# If evaluating at 12m, the first two NHCBs have the same custom values
|
||||
# while the 3rd one has different ones.
|
||||
|
||||
eval_warn instant at 12m sum_over_time(nhcb_metric[13m])
|
||||
eval instant at 12m sum_over_time(nhcb_metric[13m])
|
||||
expect warn
|
||||
|
||||
eval_warn instant at 12m avg_over_time(nhcb_metric[13m])
|
||||
eval instant at 12m avg_over_time(nhcb_metric[13m])
|
||||
expect warn
|
||||
|
||||
eval instant at 12m last_over_time(nhcb_metric[13m])
|
||||
nhcb_metric{} {{schema:-53 sum:1 count:1 custom_values:[5 10] buckets:[1]}}
|
||||
expect no_warn
|
||||
nhcb_metric{} {{schema:-53 sum:1 count:1 custom_values:[5 10] buckets:[1]}}
|
||||
|
||||
eval instant at 12m count_over_time(nhcb_metric[13m])
|
||||
{} 3
|
||||
expect no_warn
|
||||
{} 3
|
||||
|
||||
eval instant at 12m present_over_time(nhcb_metric[13m])
|
||||
{} 1
|
||||
expect no_warn
|
||||
{} 1
|
||||
|
||||
eval instant at 12m changes(nhcb_metric[13m])
|
||||
{} 1
|
||||
expect no_warn
|
||||
{} 1
|
||||
|
||||
eval_warn instant at 12m delta(nhcb_metric[13m])
|
||||
eval instant at 12m delta(nhcb_metric[13m])
|
||||
expect warn
|
||||
|
||||
eval_warn instant at 12m increase(nhcb_metric[13m])
|
||||
eval instant at 12m increase(nhcb_metric[13m])
|
||||
expect warn
|
||||
|
||||
eval_warn instant at 12m rate(nhcb_metric[13m])
|
||||
eval instant at 12m rate(nhcb_metric[13m])
|
||||
expect warn
|
||||
|
||||
eval instant at 12m resets(nhcb_metric[13m])
|
||||
{} 1
|
||||
expect no_warn
|
||||
{} 1
|
||||
|
||||
# Now doing the same again, but at 18m, where the first NHCB has
|
||||
# different custom_values compared to the other two. This now
|
||||
# works with no warning for increase() and rate(). No change
|
||||
# otherwise.
|
||||
|
||||
eval_warn instant at 18m sum_over_time(nhcb_metric[13m])
|
||||
eval instant at 18m sum_over_time(nhcb_metric[13m])
|
||||
expect warn
|
||||
|
||||
eval_warn instant at 18m avg_over_time(nhcb_metric[13m])
|
||||
eval instant at 18m avg_over_time(nhcb_metric[13m])
|
||||
expect warn
|
||||
|
||||
eval instant at 18m last_over_time(nhcb_metric[13m])
|
||||
nhcb_metric{} {{schema:-53 sum:1 count:1 custom_values:[5 10] buckets:[1]}}
|
||||
expect no_warn
|
||||
nhcb_metric{} {{schema:-53 sum:1 count:1 custom_values:[5 10] buckets:[1]}}
|
||||
|
||||
eval instant at 18m count_over_time(nhcb_metric[13m])
|
||||
{} 3
|
||||
expect no_warn
|
||||
{} 3
|
||||
|
||||
eval instant at 18m present_over_time(nhcb_metric[13m])
|
||||
{} 1
|
||||
expect no_warn
|
||||
{} 1
|
||||
|
||||
eval instant at 18m changes(nhcb_metric[13m])
|
||||
{} 1
|
||||
expect no_warn
|
||||
{} 1
|
||||
|
||||
eval_warn instant at 18m delta(nhcb_metric[13m])
|
||||
eval instant at 18m delta(nhcb_metric[13m])
|
||||
expect warn
|
||||
|
||||
eval instant at 18m increase(nhcb_metric[13m])
|
||||
{} {{schema:-53 count:1.0833333333333333 sum:1.0833333333333333 custom_values:[5 10] buckets:[1.0833333333333333]}}
|
||||
expect no_warn
|
||||
{} {{schema:-53 count:1.0833333333333333 sum:1.0833333333333333 custom_values:[5 10] buckets:[1.0833333333333333]}}
|
||||
|
||||
eval instant at 18m rate(nhcb_metric[13m])
|
||||
{} {{schema:-53 count:0.0013888888888888887 sum:0.0013888888888888887 custom_values:[5 10] buckets:[0.0013888888888888887]}}
|
||||
expect no_warn
|
||||
{} {{schema:-53 count:0.0013888888888888887 sum:0.0013888888888888887 custom_values:[5 10] buckets:[0.0013888888888888887]}}
|
||||
|
||||
eval instant at 18m resets(nhcb_metric[13m])
|
||||
{} 1
|
||||
expect no_warn
|
||||
{} 1
|
||||
|
||||
clear
|
||||
|
||||
@ -1263,7 +1351,8 @@ load 1m
|
||||
metric{group="incompatible-custom-histograms", series="1"} {{schema:-53 sum:1 count:1 custom_values:[5 10] buckets:[1]}}
|
||||
metric{group="incompatible-custom-histograms", series="2"} {{schema:-53 sum:1 count:1 custom_values:[2] buckets:[1]}}
|
||||
|
||||
eval_warn instant at 0 sum by (group) (metric)
|
||||
eval instant at 0 sum by (group) (metric)
|
||||
expect warn
|
||||
{group="just-floats"} 5
|
||||
{group="just-exponential-histograms"} {{sum:5 count:7 buckets:[2 3 2]}}
|
||||
{group="just-custom-histograms"} {{schema:-53 sum:4 count:5 custom_values:[2] buckets:[8]}}
|
||||
@ -1279,17 +1368,22 @@ load 10m
|
||||
histogram_sum_float{idx="0"} 42.0x1
|
||||
|
||||
eval instant at 10m sum(histogram_sum)
|
||||
expect no_warn
|
||||
{} {{schema:0 count:107 sum:4691.2 z_bucket:14 z_bucket_w:0.001 buckets:[3 8 2 5 3 2 2] n_buckets:[2 6 8 4 15 9 0 0 0 10 10 4]}}
|
||||
|
||||
eval_warn instant at 10m sum({idx="0"})
|
||||
eval instant at 10m sum({idx="0"})
|
||||
expect warn
|
||||
|
||||
eval instant at 10m sum(histogram_sum{idx="0"} + ignoring(idx) histogram_sum{idx="1"} + ignoring(idx) histogram_sum{idx="2"} + ignoring(idx) histogram_sum{idx="3"})
|
||||
expect no_warn
|
||||
{} {{schema:0 count:107 sum:4691.2 z_bucket:14 z_bucket_w:0.001 buckets:[3 8 2 5 3 2 2] n_buckets:[2 6 8 4 15 9 0 0 0 10 10 4]}}
|
||||
|
||||
eval instant at 10m count(histogram_sum)
|
||||
expect no_warn
|
||||
{} 4
|
||||
|
||||
eval instant at 10m avg(histogram_sum)
|
||||
expect no_warn
|
||||
{} {{schema:0 count:26.75 sum:1172.8 z_bucket:3.5 z_bucket_w:0.001 buckets:[0.75 2 0.5 1.25 0.75 0.5 0.5] n_buckets:[0.5 1.5 2 1 3.75 2.25 0 0 0 2.5 2.5 1]}}
|
||||
|
||||
clear
|
||||
|
231
promql/promqltest/testdata/operators.test
vendored
231
promql/promqltest/testdata/operators.test
vendored
@ -289,24 +289,32 @@ eval instant at 50m http_requests_total{job="api-server", instance="0", group="p
|
||||
{job="api-server", instance="0", group="production"} 1
|
||||
|
||||
# The histogram is ignored here so the result doesn't change but it has an info annotation now.
|
||||
eval_info instant at 5m {job="app-server"} == 80
|
||||
eval instant at 5m {job="app-server"} == 80
|
||||
expect info
|
||||
http_requests_total{group="canary", instance="1", job="app-server"} 80
|
||||
|
||||
eval_info instant at 5m http_requests_histogram != 80
|
||||
eval instant at 5m http_requests_histogram != 80
|
||||
expect info
|
||||
|
||||
eval_info instant at 5m http_requests_histogram > 80
|
||||
eval instant at 5m http_requests_histogram > 80
|
||||
expect info
|
||||
|
||||
eval_info instant at 5m http_requests_histogram < 80
|
||||
eval instant at 5m http_requests_histogram < 80
|
||||
expect info
|
||||
|
||||
eval_info instant at 5m http_requests_histogram >= 80
|
||||
eval instant at 5m http_requests_histogram >= 80
|
||||
expect info
|
||||
|
||||
eval_info instant at 5m http_requests_histogram <= 80
|
||||
eval instant at 5m http_requests_histogram <= 80
|
||||
expect info
|
||||
|
||||
# Should produce valid results in case of (in)equality between two histograms.
|
||||
eval instant at 5m http_requests_histogram == http_requests_histogram
|
||||
expect no_info
|
||||
http_requests_histogram{job="app-server", instance="1", group="production"} {{schema:1 sum:15 count:10 buckets:[3 2 5 7 9]}}
|
||||
|
||||
eval instant at 5m http_requests_histogram != http_requests_histogram
|
||||
expect no_info
|
||||
|
||||
# group_left/group_right.
|
||||
|
||||
@ -470,7 +478,8 @@ load 5m
|
||||
testmetric1{src="a",dst="b"} 0
|
||||
testmetric2{src="a",dst="b"} 1
|
||||
|
||||
eval_fail instant at 0m -{__name__=~'testmetric1|testmetric2'}
|
||||
eval instant at 0m -{__name__=~'testmetric1|testmetric2'}
|
||||
expect fail
|
||||
|
||||
clear
|
||||
|
||||
@ -520,290 +529,386 @@ load 6m
|
||||
right_floats_for_histograms 0 -1 2 3 4
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats == right_floats
|
||||
expect no_info
|
||||
left_floats _ _ _ _ 3 _ _ _ _ Inf -Inf
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats == bool right_floats
|
||||
expect no_info
|
||||
{} 0 _ _ _ 1 _ 0 0 0 1 1
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats == does_not_match
|
||||
expect no_info
|
||||
# No results.
|
||||
|
||||
eval range from 0 to 24m step 6m left_histograms == right_histograms
|
||||
expect no_info
|
||||
left_histograms {{schema:3 sum:4 count:4 buckets:[1 2 1]}} _ _ _ _
|
||||
|
||||
eval range from 0 to 24m step 6m left_histograms == bool right_histograms
|
||||
expect no_info
|
||||
{} 1 0 _ _ _
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms == right_floats_for_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms == right_floats_for_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms == bool right_floats_for_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms == bool right_floats_for_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats != right_floats
|
||||
expect no_info
|
||||
left_floats 1 _ _ _ _ _ 4 5 NaN _ _
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats != bool right_floats
|
||||
expect no_info
|
||||
{} 1 _ _ _ 0 _ 1 1 1 0 0
|
||||
|
||||
eval range from 0 to 24m step 6m left_histograms != right_histograms
|
||||
expect no_info
|
||||
left_histograms _ {{schema:3 sum:4.5 count:5 buckets:[1 3 1]}} _ _ _
|
||||
|
||||
eval range from 0 to 24m step 6m left_histograms != bool right_histograms
|
||||
expect no_info
|
||||
{} 0 1 _ _ _
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms != right_floats_for_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms != right_floats_for_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms != bool right_floats_for_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms != bool right_floats_for_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats > right_floats
|
||||
expect no_info
|
||||
left_floats _ _ _ _ _ _ 4 _ _ _ _
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats > bool right_floats
|
||||
expect no_info
|
||||
{} 0 _ _ _ 0 _ 1 0 0 0 0
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms > right_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms > right_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms > bool right_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms > bool right_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms > right_floats_for_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms > right_floats_for_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms > bool right_floats_for_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms > bool right_floats_for_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats >= right_floats
|
||||
expect no_info
|
||||
left_floats _ _ _ _ 3 _ 4 _ _ Inf -Inf
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats >= bool right_floats
|
||||
expect no_info
|
||||
{} 0 _ _ _ 1 _ 1 0 0 1 1
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms >= right_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms >= right_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms >= bool right_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms >= bool right_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms >= right_floats_for_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms >= right_floats_for_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms >= bool right_floats_for_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms >= bool right_floats_for_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats < right_floats
|
||||
expect no_info
|
||||
left_floats 1 _ _ _ _ _ _ 5 _ _ _
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats < bool right_floats
|
||||
expect no_info
|
||||
{} 1 _ _ _ 0 _ 0 1 0 0 0
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms < right_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms < right_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms < bool right_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms < bool right_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms < right_floats_for_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms < right_floats_for_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms < bool right_floats_for_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms < bool right_floats_for_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats <= right_floats
|
||||
expect no_info
|
||||
left_floats 1 _ _ _ 3 _ _ 5 _ Inf -Inf
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats <= bool right_floats
|
||||
expect no_info
|
||||
{} 1 _ _ _ 1 _ 0 1 0 1 1
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms <= right_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms <= right_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms <= bool right_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms <= bool right_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms <= right_floats_for_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms <= right_floats_for_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms <= bool right_floats_for_histograms
|
||||
eval range from 0 to 24m step 6m left_histograms <= bool right_floats_for_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
# Vector / scalar combinations with scalar on right side
|
||||
eval range from 0 to 60m step 6m left_floats == 3
|
||||
expect no_info
|
||||
left_floats _ _ _ _ 3 _ _ _ _ _ _
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats != 3
|
||||
expect no_info
|
||||
left_floats 1 2 _ _ _ _ 4 5 NaN Inf -Inf
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats > 3
|
||||
expect no_info
|
||||
left_floats _ _ _ _ _ _ 4 5 _ Inf _
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats >= 3
|
||||
expect no_info
|
||||
left_floats _ _ _ _ 3 _ 4 5 _ Inf _
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats < 3
|
||||
expect no_info
|
||||
left_floats 1 2 _ _ _ _ _ _ _ _ -Inf
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats <= 3
|
||||
expect no_info
|
||||
left_floats 1 2 _ _ 3 _ _ _ _ _ -Inf
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats == bool 3
|
||||
expect no_info
|
||||
{} 0 0 _ _ 1 _ 0 0 0 0 0
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats == Inf
|
||||
expect no_info
|
||||
left_floats _ _ _ _ _ _ _ _ _ Inf _
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats == bool Inf
|
||||
expect no_info
|
||||
{} 0 0 _ _ 0 _ 0 0 0 1 0
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats == NaN
|
||||
expect no_info
|
||||
# No results.
|
||||
|
||||
eval range from 0 to 60m step 6m left_floats == bool NaN
|
||||
expect no_info
|
||||
{} 0 0 _ _ 0 _ 0 0 0 0 0
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms == 3
|
||||
eval range from 0 to 24m step 6m left_histograms == 3
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms == 0
|
||||
eval range from 0 to 24m step 6m left_histograms == 0
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms != 3
|
||||
eval range from 0 to 24m step 6m left_histograms != 3
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms != 0
|
||||
eval range from 0 to 24m step 6m left_histograms != 0
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms > 3
|
||||
eval range from 0 to 24m step 6m left_histograms > 3
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms > 0
|
||||
eval range from 0 to 24m step 6m left_histograms > 0
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms >= 3
|
||||
eval range from 0 to 24m step 6m left_histograms >= 3
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms >= 0
|
||||
eval range from 0 to 24m step 6m left_histograms >= 0
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms < 3
|
||||
eval range from 0 to 24m step 6m left_histograms < 3
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms < 0
|
||||
eval range from 0 to 24m step 6m left_histograms < 0
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms <= 3
|
||||
eval range from 0 to 24m step 6m left_histograms <= 3
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms <= 0
|
||||
eval range from 0 to 24m step 6m left_histograms <= 0
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms == bool 3
|
||||
eval range from 0 to 24m step 6m left_histograms == bool 3
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms == bool 0
|
||||
eval range from 0 to 24m step 6m left_histograms == bool 0
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms != bool 3
|
||||
eval range from 0 to 24m step 6m left_histograms != bool 3
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms != bool 0
|
||||
eval range from 0 to 24m step 6m left_histograms != bool 0
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms > bool 3
|
||||
eval range from 0 to 24m step 6m left_histograms > bool 3
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms > bool 0
|
||||
eval range from 0 to 24m step 6m left_histograms > bool 0
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms >= bool 3
|
||||
eval range from 0 to 24m step 6m left_histograms >= bool 3
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms >= bool 0
|
||||
eval range from 0 to 24m step 6m left_histograms >= bool 0
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms < bool 3
|
||||
eval range from 0 to 24m step 6m left_histograms < bool 3
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms < bool 0
|
||||
eval range from 0 to 24m step 6m left_histograms < bool 0
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms <= bool 3
|
||||
eval range from 0 to 24m step 6m left_histograms <= bool 3
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m left_histograms <= bool 0
|
||||
eval range from 0 to 24m step 6m left_histograms <= bool 0
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
# Vector / scalar combinations with scalar on left side
|
||||
eval range from 0 to 60m step 6m 3 == left_floats
|
||||
expect no_info
|
||||
left_floats _ _ _ _ 3 _ _ _ _ _ _
|
||||
|
||||
eval range from 0 to 60m step 6m 3 != left_floats
|
||||
expect no_info
|
||||
left_floats 1 2 _ _ _ _ 4 5 NaN Inf -Inf
|
||||
|
||||
eval range from 0 to 60m step 6m 3 < left_floats
|
||||
expect no_info
|
||||
left_floats _ _ _ _ _ _ 4 5 _ Inf _
|
||||
|
||||
eval range from 0 to 60m step 6m 3 <= left_floats
|
||||
expect no_info
|
||||
left_floats _ _ _ _ 3 _ 4 5 _ Inf _
|
||||
|
||||
eval range from 0 to 60m step 6m 3 > left_floats
|
||||
expect no_info
|
||||
left_floats 1 2 _ _ _ _ _ _ _ _ -Inf
|
||||
|
||||
eval range from 0 to 60m step 6m 3 >= left_floats
|
||||
expect no_info
|
||||
left_floats 1 2 _ _ 3 _ _ _ _ _ -Inf
|
||||
|
||||
eval range from 0 to 60m step 6m 3 == bool left_floats
|
||||
expect no_info
|
||||
{} 0 0 _ _ 1 _ 0 0 0 0 0
|
||||
|
||||
eval range from 0 to 60m step 6m Inf == left_floats
|
||||
expect no_info
|
||||
left_floats _ _ _ _ _ _ _ _ _ Inf _
|
||||
|
||||
eval range from 0 to 60m step 6m Inf == bool left_floats
|
||||
expect no_info
|
||||
{} 0 0 _ _ 0 _ 0 0 0 1 0
|
||||
|
||||
eval range from 0 to 60m step 6m NaN == left_floats
|
||||
expect no_info
|
||||
expect no_warn
|
||||
# No results.
|
||||
|
||||
eval range from 0 to 60m step 6m NaN == bool left_floats
|
||||
expect no_info
|
||||
{} 0 0 _ _ 0 _ 0 0 0 0 0
|
||||
|
||||
eval_info range from 0 to 24m step 6m 3 == left_histograms
|
||||
eval range from 0 to 24m step 6m 3 == left_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m 0 == left_histograms
|
||||
eval range from 0 to 24m step 6m 0 == left_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m 3 != left_histograms
|
||||
eval range from 0 to 24m step 6m 3 != left_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m 0 != left_histograms
|
||||
eval range from 0 to 24m step 6m 0 != left_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m 3 < left_histograms
|
||||
eval range from 0 to 24m step 6m 3 < left_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m 0 < left_histograms
|
||||
eval range from 0 to 24m step 6m 0 < left_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m 3 < left_histograms
|
||||
eval range from 0 to 24m step 6m 3 < left_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m 0 < left_histograms
|
||||
eval range from 0 to 24m step 6m 0 < left_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m 3 > left_histograms
|
||||
eval range from 0 to 24m step 6m 3 > left_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m 0 > left_histograms
|
||||
eval range from 0 to 24m step 6m 0 > left_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m 3 >= left_histograms
|
||||
eval range from 0 to 24m step 6m 3 >= left_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
eval_info range from 0 to 24m step 6m 0 >= left_histograms
|
||||
eval range from 0 to 24m step 6m 0 >= left_histograms
|
||||
expect info
|
||||
# No results.
|
||||
|
||||
clear
|
||||
|
2
promql/promqltest/testdata/subquery.test
vendored
2
promql/promqltest/testdata/subquery.test
vendored
@ -156,4 +156,6 @@ load 5m
|
||||
foo 3+0x10
|
||||
|
||||
eval instant at 12m min_over_time((topk(1, foo))[1m:5m])
|
||||
expect no_info
|
||||
expect no_warn
|
||||
#empty
|
||||
|
Loading…
Reference in New Issue
Block a user