2024-06-17 06:43:01 +00:00
|
|
|
# sum_over_time with all values
|
2024-04-08 16:46:52 +00:00
|
|
|
load 15s
|
2024-06-17 06:43:01 +00:00
|
|
|
bar 0 1 10 100 1000
|
|
|
|
|
2024-04-08 16:46:52 +00:00
|
|
|
eval range from 0 to 1m step 30s sum_over_time(bar[30s])
|
2024-06-17 06:43:01 +00:00
|
|
|
{} 0 11 1100
|
|
|
|
|
|
|
|
clear
|
|
|
|
|
|
|
|
# sum_over_time with trailing values
|
2024-04-08 16:46:52 +00:00
|
|
|
load 15s
|
2024-06-17 06:43:01 +00:00
|
|
|
bar 0 1 10 100 1000 0 0 0 0
|
|
|
|
|
|
|
|
eval range from 0 to 2m step 1m sum_over_time(bar[30s])
|
2024-04-08 16:46:52 +00:00
|
|
|
{} 0 1100 0
|
2024-06-17 06:43:01 +00:00
|
|
|
|
|
|
|
clear
|
|
|
|
|
|
|
|
# sum_over_time with all values long
|
|
|
|
load 30s
|
|
|
|
bar 0 1 10 100 1000 10000 100000 1000000 10000000
|
|
|
|
|
|
|
|
eval range from 0 to 4m step 1m sum_over_time(bar[30s])
|
2024-04-08 16:46:52 +00:00
|
|
|
{} 0 10 1000 100000 10000000
|
2024-06-17 06:43:01 +00:00
|
|
|
|
|
|
|
clear
|
|
|
|
|
|
|
|
# sum_over_time with all values random
|
2024-04-08 16:46:52 +00:00
|
|
|
load 15s
|
2024-06-17 06:43:01 +00:00
|
|
|
bar 5 17 42 2 7 905 51
|
|
|
|
|
2024-04-08 16:46:52 +00:00
|
|
|
eval range from 0 to 90s step 30s sum_over_time(bar[30s])
|
2024-06-17 06:43:01 +00:00
|
|
|
{} 5 59 9 956
|
|
|
|
|
|
|
|
clear
|
|
|
|
|
|
|
|
# metric query
|
|
|
|
load 30s
|
|
|
|
metric 1+1x4
|
|
|
|
|
|
|
|
eval range from 0 to 2m step 1m metric
|
|
|
|
metric 1 3 5
|
|
|
|
|
|
|
|
clear
|
|
|
|
|
|
|
|
# metric query with trailing values
|
|
|
|
load 30s
|
|
|
|
metric 1+1x8
|
|
|
|
|
|
|
|
eval range from 0 to 2m step 1m metric
|
|
|
|
metric 1 3 5
|
|
|
|
|
|
|
|
clear
|
|
|
|
|
|
|
|
# short-circuit
|
|
|
|
load 30s
|
|
|
|
foo{job="1"} 1+1x4
|
|
|
|
bar{job="2"} 1+1x4
|
|
|
|
|
|
|
|
eval range from 0 to 2m step 1m foo > 2 or bar
|
|
|
|
foo{job="1"} _ 3 5
|
|
|
|
bar{job="2"} 1 3 5
|
|
|
|
|
|
|
|
clear
|
|
|
|
|
|
|
|
# Drop metric name
|
|
|
|
load 30s
|
|
|
|
requests{job="1", __address__="bar"} 100
|
|
|
|
|
|
|
|
eval range from 0 to 2m step 1m requests * 2
|
|
|
|
{job="1", __address__="bar"} 200 200 200
|
|
|
|
|
|
|
|
clear
|