Skip to content

Latest commit

 

History

History
78 lines (63 loc) · 3.37 KB

File metadata and controls

78 lines (63 loc) · 3.37 KB

Validation rules

check-severity-label

Following conditions MUST be met:

  • Alert has labels: severity
  • Alert label severity has one of the allowed values: info,warning,critical
  • Alert if rule has label severity with value info , it cannot have label page
  • Alert expression can be successfully evaluated on the live Prometheus instance and the number of time series in the result is not higher than 20 and the evaluation is not longer than 10s
  • Alert expression uses only labels that are actually present in Prometheus
  • Alert expression selectors actually matches any series in Prometheus
  • Alert expression does not use irate
  • Alert expression does not use data older than 6h0m0s

check-team-label

Following conditions MUST be met:

  • Alert has labels: xxx
  • Alert label team has one of the allowed values: [email protected] (templated values are ignored)

check-playbook-annotation

Following conditions MUST be met:

  • Alert has any of these annotations: playbook,link
  • Alert Annotation link is a valid URL and does not return HTTP status 404

check-alert-title

Following conditions MUST be met:

  • Alert has all of these annotations: title

check-prometheus-limitations

Following conditions MUST be met:

  • Rule rule does not contain typos in typos in well known: Annotations: playbook, dashboard Rule labels: do_not_inhibit Series labels: pod, locality, cluster
  • Rule expression does not use any experimental PromQL functions
  • Rule expression uses underscores as separators in large numbers in PromQL expression. Example: 1_000_000
  • Rule expression does not use data older than 6h0m0s
  • Rule does not use any of the cluster,locality,prometheus-type,replica labels is in its expression

check-metric-name

Following conditions MUST be met:

  • Alert expression uses metric name in selectors
  • Alert labels are valid templates
  • Alert keep_firing_for is not longer than 1h

check-groups

Following conditions MUST be met:

  • Group evaluation interval is between 20s and 106751d23h47m16s854ms if set
  • Group has at most 10 rules
  • Group does not have higher limit configured then 100

check-formatting

Following conditions MUST be met:

  • Rule expression is well formatted as would promtool promql format do or similar online tool such as https://o11y.tools/promqlparser/
  • Rule expression does not do any binary operations between histogram buckets, it can be dangerous because of inconsistency in the data if sent over remote write for example

check-recording-rules

Following conditions MUST be met:

  • Recording rule recorded metric name does not match regexp: ^foo_bar$
  • Recording rule recorded metric name matches regexp: ^[^:]+:[^:]+:[^:]+$

check-labels-in-expr

Following conditions MUST be met:

  • Rule for metrics matching regexp '^up$', given lables use only specified values: job: [prometheus]

  • Rule expression does not use labels app for metrics matching regexp ^up$ in the expr

test-onlyif

Only if ALL the following conditions are met:

  • Rule label severity matches regexp ^critical$
  • Group has at most 1 rules

Following conditions MUST be met:

  • Alert has labels: escalate

another-checks

Following conditions MUST be met:

  • Rule labels does not have empty values