mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 13:44:05 -08:00
Fix whitespace in promql test data
This commit is contained in:
parent
6aef22d68a
commit
4c3dc25e35
272
promql/testdata/legacy.test
vendored
272
promql/testdata/legacy.test
vendored
|
@ -22,7 +22,7 @@ load 4m
|
|||
testcounter_zero_cutoff{start="3m"} 180+240x10
|
||||
testcounter_zero_cutoff{start="4m"} 240+240x10
|
||||
testcounter_zero_cutoff{start="5m"} 300+240x10
|
||||
|
||||
|
||||
load 5m
|
||||
label_grouping_test{a="aa", b="bb"} 0+10x10
|
||||
label_grouping_test{a="a", b="abb"} 0+20x10
|
||||
|
@ -55,40 +55,40 @@ eval instant at 50m SUM(http_requests) BY (job)
|
|||
|
||||
# Non-existent labels mentioned in BY-clauses shouldn't propagate to output.
|
||||
eval instant at 50m SUM(http_requests) BY (job, nonexistent)
|
||||
{job="api-server"} 1000
|
||||
{job="app-server"} 2600
|
||||
{job="api-server"} 1000
|
||||
{job="app-server"} 2600
|
||||
|
||||
|
||||
eval instant at 50m COUNT(http_requests) BY (job)
|
||||
{job="api-server"} 4
|
||||
{job="app-server"} 4
|
||||
{job="api-server"} 4
|
||||
{job="app-server"} 4
|
||||
|
||||
|
||||
eval instant at 50m SUM(http_requests) BY (job, group)
|
||||
{group="canary", job="api-server"} 700
|
||||
{group="canary", job="app-server"} 1500
|
||||
{group="production", job="api-server"} 300
|
||||
{group="production", job="app-server"} 1100
|
||||
{group="canary", job="api-server"} 700
|
||||
{group="canary", job="app-server"} 1500
|
||||
{group="production", job="api-server"} 300
|
||||
{group="production", job="app-server"} 1100
|
||||
|
||||
|
||||
eval instant at 50m AVG(http_requests) BY (job)
|
||||
{job="api-server"} 250
|
||||
{job="app-server"} 650
|
||||
{job="api-server"} 250
|
||||
{job="app-server"} 650
|
||||
|
||||
|
||||
eval instant at 50m MIN(http_requests) BY (job)
|
||||
{job="api-server"} 100
|
||||
{job="app-server"} 500
|
||||
{job="api-server"} 100
|
||||
{job="app-server"} 500
|
||||
|
||||
|
||||
eval instant at 50m MAX(http_requests) BY (job)
|
||||
{job="api-server"} 400
|
||||
{job="app-server"} 800
|
||||
{job="api-server"} 400
|
||||
{job="app-server"} 800
|
||||
|
||||
|
||||
# Single-letter label names and values.
|
||||
eval instant at 50m x{y="testvalue"}
|
||||
x{y="testvalue"} 100
|
||||
x{y="testvalue"} 100
|
||||
|
||||
|
||||
# Deltas should be adjusted for target interval vs. samples under target interval.
|
||||
|
@ -100,7 +100,7 @@ eval instant at 50m delta(http_requests{group="canary", instance="1", job="app-s
|
|||
eval instant at 50m rate(http_requests{group="canary", instance="1", job="app-server"}[50m])
|
||||
{group="canary", instance="1", job="app-server"} 0.26666666666666666
|
||||
|
||||
|
||||
|
||||
# Counter resets at in the middle of range are handled correctly by rate().
|
||||
eval instant at 50m rate(testcounter_reset_middle[50m])
|
||||
{} 0.03
|
||||
|
@ -128,8 +128,8 @@ eval instant at 50m rate(testcounter_zero_cutoff[20m])
|
|||
{start="3m"} 0.6
|
||||
{start="4m"} 0.6
|
||||
{start="5m"} 0.6
|
||||
|
||||
|
||||
|
||||
|
||||
# count_scalar for a non-empty vector should return scalar element count.
|
||||
eval instant at 50m count_scalar(http_requests)
|
||||
8
|
||||
|
@ -139,239 +139,239 @@ eval instant at 50m count_scalar(nonexistent)
|
|||
0
|
||||
|
||||
eval instant at 50m http_requests{group!="canary"}
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
http_requests{group="production", instance="0", job="app-server"} 500
|
||||
http_requests{group="production", instance="1", job="api-server"} 200
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
http_requests{group="production", instance="0", job="app-server"} 500
|
||||
http_requests{group="production", instance="1", job="api-server"} 200
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
|
||||
eval instant at 50m http_requests{job=~".+-server",group!="canary"}
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
http_requests{group="production", instance="0", job="app-server"} 500
|
||||
http_requests{group="production", instance="1", job="api-server"} 200
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
http_requests{group="production", instance="0", job="app-server"} 500
|
||||
http_requests{group="production", instance="1", job="api-server"} 200
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
|
||||
eval instant at 50m http_requests{job!~"api-.+",group!="canary"}
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
http_requests{group="production", instance="0", job="app-server"} 500
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
http_requests{group="production", instance="0", job="app-server"} 500
|
||||
|
||||
eval instant at 50m count_scalar(http_requests{job=~"server"})
|
||||
0
|
||||
|
||||
eval instant at 50m http_requests{group="production",job=~"api-.+"}
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
http_requests{group="production", instance="1", job="api-server"} 200
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
http_requests{group="production", instance="1", job="api-server"} 200
|
||||
|
||||
eval instant at 50m abs(-1 * http_requests{group="production",job="api-server"})
|
||||
{group="production", instance="0", job="api-server"} 100
|
||||
{group="production", instance="1", job="api-server"} 200
|
||||
{group="production", instance="0", job="api-server"} 100
|
||||
{group="production", instance="1", job="api-server"} 200
|
||||
|
||||
eval instant at 50m floor(0.004 * http_requests{group="production",job="api-server"})
|
||||
{group="production", instance="0", job="api-server"} 0
|
||||
{group="production", instance="1", job="api-server"} 0
|
||||
{group="production", instance="0", job="api-server"} 0
|
||||
{group="production", instance="1", job="api-server"} 0
|
||||
|
||||
eval instant at 50m ceil(0.004 * http_requests{group="production",job="api-server"})
|
||||
{group="production", instance="0", job="api-server"} 1
|
||||
{group="production", instance="1", job="api-server"} 1
|
||||
{group="production", instance="0", job="api-server"} 1
|
||||
{group="production", instance="1", job="api-server"} 1
|
||||
|
||||
eval instant at 50m round(0.004 * http_requests{group="production",job="api-server"})
|
||||
{group="production", instance="0", job="api-server"} 0
|
||||
{group="production", instance="1", job="api-server"} 1
|
||||
{group="production", instance="0", job="api-server"} 0
|
||||
{group="production", instance="1", job="api-server"} 1
|
||||
|
||||
# Round should correctly handle negative numbers.
|
||||
eval instant at 50m round(-1 * (0.004 * http_requests{group="production",job="api-server"}))
|
||||
{group="production", instance="0", job="api-server"} 0
|
||||
{group="production", instance="1", job="api-server"} -1
|
||||
{group="production", instance="0", job="api-server"} 0
|
||||
{group="production", instance="1", job="api-server"} -1
|
||||
|
||||
# Round should round half up.
|
||||
eval instant at 50m round(0.005 * http_requests{group="production",job="api-server"})
|
||||
{group="production", instance="0", job="api-server"} 1
|
||||
{group="production", instance="1", job="api-server"} 1
|
||||
{group="production", instance="0", job="api-server"} 1
|
||||
{group="production", instance="1", job="api-server"} 1
|
||||
|
||||
eval instant at 50m round(-1 * (0.005 * http_requests{group="production",job="api-server"}))
|
||||
{group="production", instance="0", job="api-server"} 0
|
||||
{group="production", instance="1", job="api-server"} -1
|
||||
{group="production", instance="0", job="api-server"} 0
|
||||
{group="production", instance="1", job="api-server"} -1
|
||||
|
||||
eval instant at 50m round(1 + 0.005 * http_requests{group="production",job="api-server"})
|
||||
{group="production", instance="0", job="api-server"} 2
|
||||
{group="production", instance="1", job="api-server"} 2
|
||||
{group="production", instance="0", job="api-server"} 2
|
||||
{group="production", instance="1", job="api-server"} 2
|
||||
|
||||
eval instant at 50m round(-1 * (1 + 0.005 * http_requests{group="production",job="api-server"}))
|
||||
{group="production", instance="0", job="api-server"} -1
|
||||
{group="production", instance="1", job="api-server"} -2
|
||||
{group="production", instance="0", job="api-server"} -1
|
||||
{group="production", instance="1", job="api-server"} -2
|
||||
|
||||
# Round should accept the number to round nearest to.
|
||||
eval instant at 50m round(0.0005 * http_requests{group="production",job="api-server"}, 0.1)
|
||||
{group="production", instance="0", job="api-server"} 0.1
|
||||
{group="production", instance="1", job="api-server"} 0.1
|
||||
{group="production", instance="0", job="api-server"} 0.1
|
||||
{group="production", instance="1", job="api-server"} 0.1
|
||||
|
||||
eval instant at 50m round(2.1 + 0.0005 * http_requests{group="production",job="api-server"}, 0.1)
|
||||
{group="production", instance="0", job="api-server"} 2.2
|
||||
{group="production", instance="1", job="api-server"} 2.2
|
||||
{group="production", instance="0", job="api-server"} 2.2
|
||||
{group="production", instance="1", job="api-server"} 2.2
|
||||
|
||||
eval instant at 50m round(5.2 + 0.0005 * http_requests{group="production",job="api-server"}, 0.1)
|
||||
{group="production", instance="0", job="api-server"} 5.3
|
||||
{group="production", instance="1", job="api-server"} 5.3
|
||||
{group="production", instance="0", job="api-server"} 5.3
|
||||
{group="production", instance="1", job="api-server"} 5.3
|
||||
|
||||
# Round should work correctly with negative numbers and multiple decimal places.
|
||||
eval instant at 50m round(-1 * (5.2 + 0.0005 * http_requests{group="production",job="api-server"}), 0.1)
|
||||
{group="production", instance="0", job="api-server"} -5.2
|
||||
{group="production", instance="1", job="api-server"} -5.3
|
||||
{group="production", instance="0", job="api-server"} -5.2
|
||||
{group="production", instance="1", job="api-server"} -5.3
|
||||
|
||||
# Round should work correctly with big toNearests.
|
||||
eval instant at 50m round(0.025 * http_requests{group="production",job="api-server"}, 5)
|
||||
{group="production", instance="0", job="api-server"} 5
|
||||
{group="production", instance="1", job="api-server"} 5
|
||||
{group="production", instance="0", job="api-server"} 5
|
||||
{group="production", instance="1", job="api-server"} 5
|
||||
|
||||
eval instant at 50m round(0.045 * http_requests{group="production",job="api-server"}, 5)
|
||||
{group="production", instance="0", job="api-server"} 5
|
||||
{group="production", instance="1", job="api-server"} 10
|
||||
{group="production", instance="0", job="api-server"} 5
|
||||
{group="production", instance="1", job="api-server"} 10
|
||||
|
||||
eval instant at 50m avg_over_time(http_requests{group="production",job="api-server"}[1h])
|
||||
{group="production", instance="0", job="api-server"} 50
|
||||
{group="production", instance="1", job="api-server"} 100
|
||||
{group="production", instance="0", job="api-server"} 50
|
||||
{group="production", instance="1", job="api-server"} 100
|
||||
|
||||
eval instant at 50m count_over_time(http_requests{group="production",job="api-server"}[1h])
|
||||
{group="production", instance="0", job="api-server"} 11
|
||||
{group="production", instance="1", job="api-server"} 11
|
||||
{group="production", instance="0", job="api-server"} 11
|
||||
{group="production", instance="1", job="api-server"} 11
|
||||
|
||||
eval instant at 50m max_over_time(http_requests{group="production",job="api-server"}[1h])
|
||||
{group="production", instance="0", job="api-server"} 100
|
||||
{group="production", instance="1", job="api-server"} 200
|
||||
{group="production", instance="0", job="api-server"} 100
|
||||
{group="production", instance="1", job="api-server"} 200
|
||||
|
||||
eval instant at 50m min_over_time(http_requests{group="production",job="api-server"}[1h])
|
||||
{group="production", instance="0", job="api-server"} 0
|
||||
{group="production", instance="1", job="api-server"} 0
|
||||
{group="production", instance="0", job="api-server"} 0
|
||||
{group="production", instance="1", job="api-server"} 0
|
||||
|
||||
eval instant at 50m sum_over_time(http_requests{group="production",job="api-server"}[1h])
|
||||
{group="production", instance="0", job="api-server"} 550
|
||||
{group="production", instance="1", job="api-server"} 1100
|
||||
{group="production", instance="0", job="api-server"} 550
|
||||
{group="production", instance="1", job="api-server"} 1100
|
||||
|
||||
eval instant at 50m time()
|
||||
3000
|
||||
|
||||
eval instant at 50m drop_common_labels(http_requests{group="production",job="api-server"})
|
||||
http_requests{instance="0"} 100
|
||||
http_requests{instance="1"} 200
|
||||
http_requests{instance="0"} 100
|
||||
http_requests{instance="1"} 200
|
||||
|
||||
eval instant at 50m {__name__=~".+"}
|
||||
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
|
||||
http_requests{group="canary", instance="1", job="app-server"} 800
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
http_requests{group="production", instance="0", job="app-server"} 500
|
||||
http_requests{group="production", instance="1", job="api-server"} 200
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
testcounter_reset_end 0
|
||||
testcounter_reset_middle 50
|
||||
x{y="testvalue"} 100
|
||||
label_grouping_test{a="a", b="abb"} 200
|
||||
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
|
||||
http_requests{group="canary", instance="1", job="app-server"} 800
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
http_requests{group="production", instance="0", job="app-server"} 500
|
||||
http_requests{group="production", instance="1", job="api-server"} 200
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
testcounter_reset_end 0
|
||||
testcounter_reset_middle 50
|
||||
x{y="testvalue"} 100
|
||||
label_grouping_test{a="a", b="abb"} 200
|
||||
label_grouping_test{a="aa", b="bb"} 100
|
||||
vector_matching_a{l="x"} 10
|
||||
vector_matching_a{l="y"} 20
|
||||
vector_matching_b{l="x"} 40
|
||||
cpu_count{instance="1", type="smp"} 200
|
||||
cpu_count{instance="0", type="smp"} 100
|
||||
cpu_count{instance="0", type="numa"} 300
|
||||
vector_matching_a{l="x"} 10
|
||||
vector_matching_a{l="y"} 20
|
||||
vector_matching_b{l="x"} 40
|
||||
cpu_count{instance="1", type="smp"} 200
|
||||
cpu_count{instance="0", type="smp"} 100
|
||||
cpu_count{instance="0", type="numa"} 300
|
||||
|
||||
|
||||
eval instant at 50m {job=~".+-server", job!~"api-.+"}
|
||||
http_requests{group="canary", instance="0", job="app-server"} 700
|
||||
http_requests{group="canary", instance="1", job="app-server"} 800
|
||||
http_requests{group="production", instance="0", job="app-server"} 500
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
http_requests{group="canary", instance="0", job="app-server"} 700
|
||||
http_requests{group="canary", instance="1", job="app-server"} 800
|
||||
http_requests{group="production", instance="0", job="app-server"} 500
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
|
||||
eval instant at 50m absent(nonexistent)
|
||||
{} 1
|
||||
{} 1
|
||||
|
||||
|
||||
eval instant at 50m absent(nonexistent{job="testjob", instance="testinstance", method=~".x"})
|
||||
{instance="testinstance", job="testjob"} 1
|
||||
{instance="testinstance", job="testjob"} 1
|
||||
|
||||
eval instant at 50m count_scalar(absent(http_requests))
|
||||
0
|
||||
0
|
||||
|
||||
eval instant at 50m count_scalar(absent(sum(http_requests)))
|
||||
0
|
||||
0
|
||||
|
||||
eval instant at 50m absent(sum(nonexistent{job="testjob", instance="testinstance"}))
|
||||
{} 1
|
||||
{} 1
|
||||
|
||||
eval instant at 50m http_requests{group="production",job="api-server"} offset 5m
|
||||
http_requests{group="production", instance="0", job="api-server"} 90
|
||||
http_requests{group="production", instance="1", job="api-server"} 180
|
||||
http_requests{group="production", instance="0", job="api-server"} 90
|
||||
http_requests{group="production", instance="1", job="api-server"} 180
|
||||
|
||||
eval instant at 50m rate(http_requests{group="production",job="api-server"}[10m] offset 5m)
|
||||
{group="production", instance="0", job="api-server"} 0.03333333333333333
|
||||
{group="production", instance="1", job="api-server"} 0.06666666666666667
|
||||
{group="production", instance="0", job="api-server"} 0.03333333333333333
|
||||
{group="production", instance="1", job="api-server"} 0.06666666666666667
|
||||
|
||||
eval instant at 50m http_requests{group="canary", instance="0", job="api-server"} / 0
|
||||
{group="canary", instance="0", job="api-server"} +Inf
|
||||
{group="canary", instance="0", job="api-server"} +Inf
|
||||
|
||||
eval instant at 50m -1 * http_requests{group="canary", instance="0", job="api-server"} / 0
|
||||
{group="canary", instance="0", job="api-server"} -Inf
|
||||
{group="canary", instance="0", job="api-server"} -Inf
|
||||
|
||||
eval instant at 50m 0 * http_requests{group="canary", instance="0", job="api-server"} / 0
|
||||
{group="canary", instance="0", job="api-server"} NaN
|
||||
{group="canary", instance="0", job="api-server"} NaN
|
||||
|
||||
eval instant at 50m 0 * http_requests{group="canary", instance="0", job="api-server"} % 0
|
||||
{group="canary", instance="0", job="api-server"} NaN
|
||||
{group="canary", instance="0", job="api-server"} NaN
|
||||
|
||||
eval instant at 50m exp(vector_matching_a)
|
||||
{l="x"} 22026.465794806718
|
||||
{l="y"} 485165195.4097903
|
||||
{l="x"} 22026.465794806718
|
||||
{l="y"} 485165195.4097903
|
||||
|
||||
eval instant at 50m exp(vector_matching_a - 10)
|
||||
{l="y"} 22026.465794806718
|
||||
{l="x"} 1
|
||||
{l="y"} 22026.465794806718
|
||||
{l="x"} 1
|
||||
|
||||
eval instant at 50m exp(vector_matching_a - 20)
|
||||
{l="x"} 4.5399929762484854e-05
|
||||
{l="y"} 1
|
||||
{l="x"} 4.5399929762484854e-05
|
||||
{l="y"} 1
|
||||
|
||||
eval instant at 50m ln(vector_matching_a)
|
||||
{l="x"} 2.302585092994046
|
||||
{l="y"} 2.995732273553991
|
||||
{l="x"} 2.302585092994046
|
||||
{l="y"} 2.995732273553991
|
||||
|
||||
eval instant at 50m ln(vector_matching_a - 10)
|
||||
{l="y"} 2.302585092994046
|
||||
{l="x"} -Inf
|
||||
{l="y"} 2.302585092994046
|
||||
{l="x"} -Inf
|
||||
|
||||
eval instant at 50m ln(vector_matching_a - 20)
|
||||
{l="y"} -Inf
|
||||
{l="x"} NaN
|
||||
{l="y"} -Inf
|
||||
{l="x"} NaN
|
||||
|
||||
eval instant at 50m exp(ln(vector_matching_a))
|
||||
{l="y"} 20
|
||||
{l="x"} 10
|
||||
{l="y"} 20
|
||||
{l="x"} 10
|
||||
|
||||
eval instant at 50m sqrt(vector_matching_a)
|
||||
{l="x"} 3.1622776601683795
|
||||
{l="y"} 4.47213595499958
|
||||
{l="x"} 3.1622776601683795
|
||||
{l="y"} 4.47213595499958
|
||||
|
||||
eval instant at 50m log2(vector_matching_a)
|
||||
{l="x"} 3.3219280948873626
|
||||
{l="y"} 4.321928094887363
|
||||
{l="x"} 3.3219280948873626
|
||||
{l="y"} 4.321928094887363
|
||||
|
||||
eval instant at 50m log2(vector_matching_a - 10)
|
||||
{l="y"} 3.3219280948873626
|
||||
{l="x"} -Inf
|
||||
{l="y"} 3.3219280948873626
|
||||
{l="x"} -Inf
|
||||
|
||||
eval instant at 50m log2(vector_matching_a - 20)
|
||||
{l="x"} NaN
|
||||
{l="y"} -Inf
|
||||
{l="x"} NaN
|
||||
{l="y"} -Inf
|
||||
|
||||
eval instant at 50m log10(vector_matching_a)
|
||||
{l="x"} 1
|
||||
{l="y"} 1.301029995663981
|
||||
{l="x"} 1
|
||||
{l="y"} 1.301029995663981
|
||||
|
||||
eval instant at 50m log10(vector_matching_a - 10)
|
||||
{l="y"} 1
|
||||
{l="x"} -Inf
|
||||
{l="y"} 1
|
||||
{l="x"} -Inf
|
||||
|
||||
eval instant at 50m log10(vector_matching_a - 20)
|
||||
{l="x"} NaN
|
||||
{l="y"} -Inf
|
||||
{l="x"} NaN
|
||||
{l="y"} -Inf
|
||||
|
||||
|
||||
# Matrix tests.
|
||||
|
|
142
promql/testdata/operators.test
vendored
142
promql/testdata/operators.test
vendored
|
@ -16,132 +16,132 @@ load 5m
|
|||
|
||||
|
||||
eval instant at 50m SUM(http_requests) BY (job) - COUNT(http_requests) BY (job)
|
||||
{job="api-server"} 996
|
||||
{job="app-server"} 2596
|
||||
{job="api-server"} 996
|
||||
{job="app-server"} 2596
|
||||
|
||||
eval instant at 50m 2 - SUM(http_requests) BY (job)
|
||||
{job="api-server"} -998
|
||||
{job="app-server"} -2598
|
||||
{job="api-server"} -998
|
||||
{job="app-server"} -2598
|
||||
|
||||
eval instant at 50m 1000 / SUM(http_requests) BY (job)
|
||||
{job="api-server"} 1
|
||||
{job="app-server"} 0.38461538461538464
|
||||
{job="api-server"} 1
|
||||
{job="app-server"} 0.38461538461538464
|
||||
|
||||
eval instant at 50m SUM(http_requests) BY (job) - 2
|
||||
{job="api-server"} 998
|
||||
{job="app-server"} 2598
|
||||
{job="api-server"} 998
|
||||
{job="app-server"} 2598
|
||||
|
||||
eval instant at 50m SUM(http_requests) BY (job) % 3
|
||||
{job="api-server"} 1
|
||||
{job="app-server"} 2
|
||||
{job="api-server"} 1
|
||||
{job="app-server"} 2
|
||||
|
||||
eval instant at 50m SUM(http_requests) BY (job) / 0
|
||||
{job="api-server"} +Inf
|
||||
{job="app-server"} +Inf
|
||||
{job="api-server"} +Inf
|
||||
{job="app-server"} +Inf
|
||||
|
||||
eval instant at 50m SUM(http_requests) BY (job) + SUM(http_requests) BY (job)
|
||||
{job="api-server"} 2000
|
||||
{job="app-server"} 5200
|
||||
{job="api-server"} 2000
|
||||
{job="app-server"} 5200
|
||||
|
||||
|
||||
eval instant at 50m http_requests{job="api-server", group="canary"}
|
||||
http_requests{group="canary", instance="0", job="api-server"} 300
|
||||
http_requests{group="canary", instance="1", job="api-server"} 400
|
||||
http_requests{group="canary", instance="0", job="api-server"} 300
|
||||
http_requests{group="canary", instance="1", job="api-server"} 400
|
||||
|
||||
eval instant at 50m http_requests{job="api-server", group="canary"} + rate(http_requests{job="api-server"}[5m]) * 5 * 60
|
||||
{group="canary", instance="0", job="api-server"} 330
|
||||
{group="canary", instance="1", job="api-server"} 440
|
||||
{group="canary", instance="0", job="api-server"} 330
|
||||
{group="canary", instance="1", job="api-server"} 440
|
||||
|
||||
eval instant at 50m rate(http_requests[25m]) * 25 * 60
|
||||
{group="canary", instance="0", job="api-server"} 150
|
||||
{group="canary", instance="0", job="app-server"} 350
|
||||
{group="canary", instance="1", job="api-server"} 200
|
||||
{group="canary", instance="1", job="app-server"} 400
|
||||
{group="production", instance="0", job="api-server"} 50
|
||||
{group="production", instance="0", job="app-server"} 249.99999999999997
|
||||
{group="production", instance="1", job="api-server"} 100
|
||||
{group="production", instance="1", job="app-server"} 300
|
||||
{group="canary", instance="0", job="api-server"} 150
|
||||
{group="canary", instance="0", job="app-server"} 350
|
||||
{group="canary", instance="1", job="api-server"} 200
|
||||
{group="canary", instance="1", job="app-server"} 400
|
||||
{group="production", instance="0", job="api-server"} 50
|
||||
{group="production", instance="0", job="app-server"} 249.99999999999997
|
||||
{group="production", instance="1", job="api-server"} 100
|
||||
{group="production", instance="1", job="app-server"} 300
|
||||
|
||||
|
||||
eval instant at 50m http_requests{group="canary"} and http_requests{instance="0"}
|
||||
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="0", job="api-server"} 300
|
||||
http_requests{group="canary", instance="0", job="app-server"} 700
|
||||
|
||||
eval instant at 50m (http_requests{group="canary"} + 1) and http_requests{instance="0"}
|
||||
{group="canary", instance="0", job="api-server"} 301
|
||||
{group="canary", instance="0", job="app-server"} 701
|
||||
{group="canary", instance="0", job="api-server"} 301
|
||||
{group="canary", instance="0", job="app-server"} 701
|
||||
|
||||
eval instant at 50m (http_requests{group="canary"} + 1) and on(instance, job) http_requests{instance="0", group="production"}
|
||||
{group="canary", instance="0", job="api-server"} 301
|
||||
{group="canary", instance="0", job="app-server"} 701
|
||||
{group="canary", instance="0", job="api-server"} 301
|
||||
{group="canary", instance="0", job="app-server"} 701
|
||||
|
||||
eval instant at 50m (http_requests{group="canary"} + 1) and on(instance) http_requests{instance="0", group="production"}
|
||||
{group="canary", instance="0", job="api-server"} 301
|
||||
{group="canary", instance="0", job="app-server"} 701
|
||||
{group="canary", instance="0", job="api-server"} 301
|
||||
{group="canary", instance="0", job="app-server"} 701
|
||||
|
||||
eval instant at 50m http_requests{group="canary"} or http_requests{group="production"}
|
||||
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
|
||||
http_requests{group="canary", instance="1", job="app-server"} 800
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
http_requests{group="production", instance="0", job="app-server"} 500
|
||||
http_requests{group="production", instance="1", job="api-server"} 200
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
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
|
||||
http_requests{group="canary", instance="1", job="app-server"} 800
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
http_requests{group="production", instance="0", job="app-server"} 500
|
||||
http_requests{group="production", instance="1", job="api-server"} 200
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
|
||||
# On overlap the rhs samples must be dropped.
|
||||
eval instant at 50m (http_requests{group="canary"} + 1) or http_requests{instance="1"}
|
||||
{group="canary", instance="0", job="api-server"} 301
|
||||
{group="canary", instance="0", job="app-server"} 701
|
||||
{group="canary", instance="1", job="api-server"} 401
|
||||
{group="canary", instance="1", job="app-server"} 801
|
||||
http_requests{group="production", instance="1", job="api-server"} 200
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
{group="canary", instance="0", job="api-server"} 301
|
||||
{group="canary", instance="0", job="app-server"} 701
|
||||
{group="canary", instance="1", job="api-server"} 401
|
||||
{group="canary", instance="1", job="app-server"} 801
|
||||
http_requests{group="production", instance="1", job="api-server"} 200
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
|
||||
|
||||
# Matching only on instance excludes everything that has instance=0/1 but includes
|
||||
# entries without the instance label.
|
||||
eval instant at 50m (http_requests{group="canary"} + 1) or on(instance) (http_requests or cpu_count or vector_matching_a)
|
||||
{group="canary", instance="0", job="api-server"} 301
|
||||
{group="canary", instance="0", job="app-server"} 701
|
||||
{group="canary", instance="1", job="api-server"} 401
|
||||
{group="canary", instance="1", job="app-server"} 801
|
||||
vector_matching_a{l="x"} 10
|
||||
vector_matching_a{l="y"} 20
|
||||
{group="canary", instance="0", job="api-server"} 301
|
||||
{group="canary", instance="0", job="app-server"} 701
|
||||
{group="canary", instance="1", job="api-server"} 401
|
||||
{group="canary", instance="1", job="app-server"} 801
|
||||
vector_matching_a{l="x"} 10
|
||||
vector_matching_a{l="y"} 20
|
||||
|
||||
eval instant at 50m http_requests{group="canary"} / on(instance,job) http_requests{group="production"}
|
||||
{instance="0", job="api-server"} 3
|
||||
{instance="0", job="app-server"} 1.4
|
||||
{instance="1", job="api-server"} 2
|
||||
{instance="1", job="app-server"} 1.3333333333333333
|
||||
{instance="0", job="api-server"} 3
|
||||
{instance="0", job="app-server"} 1.4
|
||||
{instance="1", job="api-server"} 2
|
||||
{instance="1", job="app-server"} 1.3333333333333333
|
||||
|
||||
# https://github.com/prometheus/prometheus/issues/1489
|
||||
eval instant at 50m http_requests AND ON (dummy) vector(1)
|
||||
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
|
||||
http_requests{group="canary", instance="1", job="app-server"} 800
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
http_requests{group="production", instance="0", job="app-server"} 500
|
||||
http_requests{group="production", instance="1", job="api-server"} 200
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
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
|
||||
http_requests{group="canary", instance="1", job="app-server"} 800
|
||||
http_requests{group="production", instance="0", job="api-server"} 100
|
||||
http_requests{group="production", instance="0", job="app-server"} 500
|
||||
http_requests{group="production", instance="1", job="api-server"} 200
|
||||
http_requests{group="production", instance="1", job="app-server"} 600
|
||||
|
||||
|
||||
# Comparisons.
|
||||
eval instant at 50m SUM(http_requests) BY (job) > 1000
|
||||
{job="app-server"} 2600
|
||||
{job="app-server"} 2600
|
||||
|
||||
eval instant at 50m 1000 < SUM(http_requests) BY (job)
|
||||
{job="app-server"} 1000
|
||||
{job="app-server"} 1000
|
||||
|
||||
eval instant at 50m SUM(http_requests) BY (job) <= 1000
|
||||
{job="api-server"} 1000
|
||||
{job="api-server"} 1000
|
||||
|
||||
eval instant at 50m SUM(http_requests) BY (job) != 1000
|
||||
{job="app-server"} 2600
|
||||
{job="app-server"} 2600
|
||||
|
||||
eval instant at 50m SUM(http_requests) BY (job) == 1000
|
||||
{job="api-server"} 1000
|
||||
{job="api-server"} 1000
|
||||
|
||||
eval instant at 50m SUM(http_requests) BY (job) == bool 1000
|
||||
{job="api-server"} 1
|
||||
|
|
Loading…
Reference in a new issue