2019-06-26 00:07:52 +00:00
|
|
|
name: grafana
|
|
|
|
rules:
|
|
|
|
- name: production dashboards should have production alerts
|
|
|
|
desc: dashboards with the production tag must use notification channels with production in the name
|
|
|
|
level: info
|
|
|
|
tags:
|
|
|
|
- grafana
|
|
|
|
- dashboard
|
|
|
|
|
2019-06-26 12:10:05 +00:00
|
|
|
# this is not the ideal selector for this rule, but tags are located at $.dashboard.tags, while notification
|
|
|
|
# channels are nested under $.dashboard.panels[*].alert.notifications[*].uid
|
2019-06-26 12:46:55 +00:00
|
|
|
select: '$.dashboard'
|
2019-06-26 00:07:52 +00:00
|
|
|
|
|
|
|
filter:
|
|
|
|
type: object
|
|
|
|
properties:
|
2019-06-26 12:46:55 +00:00
|
|
|
tags:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
contains:
|
|
|
|
pattern: production
|
2019-06-26 00:07:52 +00:00
|
|
|
|
|
|
|
check:
|
|
|
|
type: object
|
|
|
|
properties:
|
2019-06-26 12:46:55 +00:00
|
|
|
panels:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
alert:
|
2019-06-26 00:07:52 +00:00
|
|
|
type: object
|
|
|
|
properties:
|
2019-06-26 12:46:55 +00:00
|
|
|
notifications:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required: [uid]
|
|
|
|
properties:
|
|
|
|
uid:
|
|
|
|
type: string
|
|
|
|
pattern: production
|