From f2579d4a5aa0e30c79c00963016ce2f0fd2e8874 Mon Sep 17 00:00:00 2001 From: ssube Date: Tue, 25 Jun 2019 19:07:52 -0500 Subject: [PATCH] feat(rules): add example grafana rule --- rules/grafana.yml | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 rules/grafana.yml diff --git a/rules/grafana.yml b/rules/grafana.yml new file mode 100644 index 0000000..8b52365 --- /dev/null +++ b/rules/grafana.yml @@ -0,0 +1,48 @@ +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 + + select: '$' + + filter: + type: object + properties: + dashboard: + type: object + properties: + tags: + type: array + items: + type: string + contains: + pattern: production + + check: + type: object + properties: + dashboard: + type: object + properties: + panels: + type: array + items: + type: object + properties: + alert: + type: object + properties: + notifications: + type: array + items: + type: object + required: [uid] + additionalProperties: false + properties: + uid: + type: string + pattern: production \ No newline at end of file