From 30cc35cbac2b4cae26312386d7dea100375030ee Mon Sep 17 00:00:00 2001 From: Filipe Sequeira Date: Fri, 4 Feb 2022 12:19:47 +0000 Subject: [PATCH] update docs with grafana section --- docs/spec/v1beta1/provider.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/docs/spec/v1beta1/provider.md b/docs/spec/v1beta1/provider.md index 107c9288e..903beac77 100644 --- a/docs/spec/v1beta1/provider.md +++ b/docs/spec/v1beta1/provider.md @@ -58,6 +58,7 @@ Notification providers: * Generic webhook * Opsgenie * Alertmanager +* Grafana Git commit status providers: @@ -118,7 +119,7 @@ kubectl create secret generic webhook-url \ Note that the secret must contain an `address` field. The provider type can be: `slack`, `msteams`, `rocket`, `discord`, `googlechat`, `webex`, `sentry`, -`telegram`, `lark`, `matrix`, `azureeventhub`, `opsgenie`, `alertmanager` or `generic`. +`telegram`, `lark`, `matrix`, `azureeventhub`, `opsgenie`, `alertmanager`, `grafana` or `generic`. When type `generic` is specified, the notification controller will post the incoming [event](event.md) in JSON format to the webhook address. @@ -405,6 +406,35 @@ spec: ``` +### Grafana + +Sends notifications to [grafana annotations api](https://grafana.com/docs/grafana/latest/http_api/annotations/) +if grafana has authentication configured it is recommended to use secretRef and include the API key. +To enable the annotations on a Dashboard its needed to enable the annotations with Tag `flux` on the Dashboard settings by. +This can be be performed by doing the following steps: +* Annotations > Query > Enable Match any +* Annotations > Query > Tags (Add Tag: `flux`) + + +```shell +kubectl create secret generic grafana-token \ +--from-literal=token= \ +--from-literal=address=https:///api/annotations +``` + +Then reference the secret in `spec.secretRef`: + +```yaml +apiVersion: notification.toolkit.fluxcd.io/v1beta1 +kind: Provider +metadata: + name: grafana + namespace: default +spec: + type: grafana + secretRef: + name: grafana-token +``` ### Git commit status The GitHub, GitLab, Bitbucket, and Azure DevOps provider will write to the