forked from thanos-io/kube-thanos
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtests.yaml
94 lines (92 loc) · 3.13 KB
/
tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
rule_files:
- jsonnet/thanos-mixin/alerts.yaml
- jsonnet/thanos-mixin/rules.yaml
evaluation_interval: 1m
tests:
- interval: 1m
input_series:
- series: 'thanos_sidecar_last_heartbeat_success_time_seconds{namespace="production", job="thanos-sidecar", pod="thanos-sidecar-pod-0"}'
values: '5 10 43 17 11 0 0 0'
- series: 'thanos_sidecar_last_heartbeat_success_time_seconds{namespace="production", job="thanos-sidecar", pod="thanos-sidecar-pod-1"}'
values: '4 9 42 15 10 0 0 0'
promql_expr_test:
- expr: time()
eval_time: 1m
exp_samples:
- labels: '{}'
value: 60
- expr: time()
eval_time: 2m
exp_samples:
- labels: '{}'
value: 120
- expr: max(thanos_sidecar_last_heartbeat_success_time_seconds{job="thanos-sidecar"}) by (pod)
eval_time: 2m
exp_samples:
- labels: '{pod="thanos-sidecar-pod-0"}'
value: 43
- labels: '{pod="thanos-sidecar-pod-1"}'
value: 42
- expr: max(thanos_sidecar_last_heartbeat_success_time_seconds{job="thanos-sidecar"}) by (pod)
eval_time: 5m
exp_samples:
- labels: '{pod="thanos-sidecar-pod-0"}'
value: 0
- labels: '{pod="thanos-sidecar-pod-1"}'
value: 0
- expr: max(thanos_sidecar_last_heartbeat_success_time_seconds{job="thanos-sidecar"}) by (pod)
eval_time: 6m
exp_samples:
- labels: '{pod="thanos-sidecar-pod-0"}'
value: 0
- labels: '{pod="thanos-sidecar-pod-1"}'
value: 0
- expr: time() - max(thanos_sidecar_last_heartbeat_success_time_seconds{job="thanos-sidecar"}) by (pod)
eval_time: 5m
exp_samples:
- labels: '{pod="thanos-sidecar-pod-0"}'
value: 300
- labels: '{pod="thanos-sidecar-pod-1"}'
value: 300
- expr: time() - max(thanos_sidecar_last_heartbeat_success_time_seconds{job="thanos-sidecar"}) by (pod)
eval_time: 6m
exp_samples:
- labels: '{pod="thanos-sidecar-pod-0"}'
value: 360
- labels: '{pod="thanos-sidecar-pod-1"}'
value: 360
- expr: time() - max(thanos_sidecar_last_heartbeat_success_time_seconds{job="thanos-sidecar"}) by (pod) >= 300
eval_time: 12m
exp_samples:
- labels: '{pod="thanos-sidecar-pod-0"}'
value: 720
- labels: '{pod="thanos-sidecar-pod-1"}'
value: 720
alert_rule_test:
- eval_time: 1m
alertname: ThanosSidecarUnhealthy
- eval_time: 2m
alertname: ThanosSidecarUnhealthy
- eval_time: 3m
alertname: ThanosSidecarUnhealthy
- eval_time: 5m
alertname: ThanosSidecarUnhealthy
exp_alerts:
- exp_labels:
severity: critical
exp_annotations:
message: 'Thanos Sidecar is unhealthy for 2 seconds.'
- eval_time: 6m
alertname: ThanosSidecarUnhealthy
exp_alerts:
- exp_labels:
severity: critical
exp_annotations:
message: 'Thanos Sidecar is unhealthy for 2 seconds.'
- eval_time: 12m
alertname: ThanosSidecarUnhealthy
exp_alerts:
- exp_labels:
severity: critical
exp_annotations:
message: 'Thanos Sidecar is unhealthy for 2 seconds.'