From 2d05ef9b519c57c94cab7300e840438a1c83b7c3 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 Signed-off-by: Filipe Sequeira --- docs/spec/v1beta1/provider.md | 36 ++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/docs/spec/v1beta1/provider.md b/docs/spec/v1beta1/provider.md index 27e0654a9..542538405 100644 --- a/docs/spec/v1beta1/provider.md +++ b/docs/spec/v1beta1/provider.md @@ -52,6 +52,7 @@ Notification providers: | Discord | discord | | Generic webhook | generic | | Google Chat | googlechat | +| Grafana | grafana | | Lark | lark | | Matrix | matrix | | Microsoft Teams | msteams | @@ -122,7 +123,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. @@ -336,7 +337,6 @@ spec: name: opsgenie-token ``` - ### Prometheus Alertmanager Sends notifications to [alertmanager v2 api](https://github.com/prometheus/alertmanager/blob/main/api/v2/openapi.yaml) if alert manager has basic authentication configured it is recommended to use @@ -370,7 +370,6 @@ The provider will send the following labels for the event. | name | The name of the involved object associated with the event | | namespace | The namespace of the involved object associated with the event | - ### Slack App It is possible to use a Slack App bot integration to send messages. To obtain a bot token, follow @@ -409,6 +408,36 @@ 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 @@ -491,6 +520,7 @@ metadata: data: token: ``` + ### Azure Event Hub The Azure Event Hub supports two authentication methods, [JWT](https://docs.microsoft.com/en-us/azure/event-hubs/authenticate-application)