Last active
November 23, 2020 06:44
-
-
Save FUSAKLA/ac72683b5b4f5b604161f1af9dffba1a to your computer and use it in GitHub Desktop.
promruval severity example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
validationRules: | |
- name: check-severity-label | |
scope: Alert # Defines which rule types should be validated by this rule. | |
validations: | |
- type: hasLabels # Name of the validation check. | |
params: # Each validation check has its own params depending on the type. | |
labels: [ "severity" ] | |
- type: labelHasAllowedValue | |
params: | |
label: "severity" | |
allowedValues: [ "info", "warning", "critical" ] | |
- name: check-playbook-annotation | |
scope: Alert | |
validations: | |
- type: hasAnnotations | |
params: | |
annotations: [ "playbook", "title"] | |
- type: annotationIsValidURL | |
params: | |
annotation: "playbook" | |
resolveUrl: true # Actually makes HTTP request anch checks for 404 status code. | |
- name: check-prometheus-limitations | |
scope: All rules | |
validations: | |
- type: expressionDoesNotUseOlderDataThan | |
params: | |
limit: "5d" # Parses the PromQL and checks all range selectors, offsets and subqueries. | |
- type: expressionDoesNotUseLabels | |
params: | |
labels: [ "cluster", "dc" ] # Parses the PromQL and checks if the labels are not used in selectors, grouping or joining metrics. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment