-
Notifications
You must be signed in to change notification settings - Fork 5
/
validation.yaml
122 lines (112 loc) · 3.2 KB
/
validation.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# customExcludeAnnotation: my_disable_annotation
# customDisableComment: my_disable_comment
prometheus:
url: http://demo.robustperception.io:9090
validationRules:
- name: check-severity-label
scope: Alert
validations:
- type: hasLabels
params:
labels: ["severity"]
- type: labelHasAllowedValue
paramsFromFile: ./allowed_values_params.yaml
- type: exclusiveLabels
params:
firstLabel: severity
firstLabelValue: info
secondLabel: page
- type: expressionCanBeEvaluated
params:
timeSeriesLimit: 20
evaluationDurationLimit: 10s
- type: expressionUsesExistingLabels
- type: expressionDoesNotUseIrate
additionalDetails: "Just do as I say!"
- type: expressionSelectorsMatchesAnything
- type: expressionDoesNotUseOlderDataThan
params:
limit: "6h"
- name: check-team-label
scope: Alert
validations:
- type: hasLabels
params:
labels: ["xxx"]
- type: labelHasAllowedValue
params:
label: "team"
allowedValues:
- "sre@company.com"
ignoreTemplatedValues: true
- name: check-playbook-annotation
scope: Alert
validations:
- type: hasAnyOfAnnotations
params:
annotations: ["playbook", "link"]
- type: annotationIsValidURL
params:
annotation: "link"
resolveUrl: true
- name: check-alert-title
scope: Alert
validations:
- type: hasAnnotations
params:
annotations: ["title"]
- name: check-prometheus-limitations
scope: All rules
validations:
- type: expressionDoesNotUseOlderDataThan
params:
limit: "6h"
- type: expressionDoesNotUseLabels
params:
labels: ["cluster", "locality", "prometheus-type", "replica"]
- name: check-source-tenants
scope: All rules
validations:
- type: hasSourceTenantsForMetrics
params:
sourceTenants:
"k8s":
- regexp: "container_.*"
description: "Metrics from cAdvisor"
- regexp: "kube_.*"
description: "Metrics from KSM"
"mysql":
- regexp: "mysql_.*"
description: "MySQL metrics from the MySQL team"
- name: check-metric-name
scope: Alert
validations:
- type: expressionWithNoMetricName
- type: validateLabelTemplates
- type: keepFiringForIsNotLongerThan
params:
limit: "1h"
- name: check-groups
scope: Group
validations:
- type: hasAllowedSourceTenants
params:
allowedSourceTenants: ["tenant1", "tenant2", "k8s"]
- type: hasAllowedEvaluationInterval
params:
minimum: "20s"
intervalMustBeSet: false
- type: hasValidPartialStrategy
- type: maxRulesPerGroup
params:
limit: 10
- type: hasAllowedLimit
params:
limit: 100
- name: check-formatting
scope: All rules
validations:
- type: expressionIsWellFormatted
params:
showExpectedForm: true
skipExpressionsWithComments: true