Skip to content

Commit

Permalink
test: (wip) add apiserver tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzofelletti committed Dec 16, 2024
1 parent 26a88f4 commit 03f2433
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/apiserver-availability-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
rule_files:
- ../prometheus_alerts.yaml
- ../prometheus_rules.yaml

evaluation_interval: 1m

tests:
- interval: 1m
input_series:
# 100 requests in the overall interval, 99 successful and 1 error
- series: 'apiserver_request_total{job="kube-apiserver",verb="GET",code="200"}'
values: '0 10 20 50 90 99'
- series: 'apiserver_request_total{job="kube-apiserver",verb="GET",code="500"}'
values: '0 0 0 1 1 1'

promql_expr_test:
- eval_time: 5m
expr: code_verb:apiserver_request_total:increase1h{verb="GET"}
exp_samples:
- labels: '{__name__="code_verb:apiserver_request_total:increase1h", code="200", verb="GET"}'
value: 99.0
- labels: '{__name__="code_verb:apiserver_request_total:increase1h", code="500", verb="GET"}'
value: 1.0

0 comments on commit 03f2433

Please sign in to comment.