Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Grafana annotations API #322

Merged
merged 1 commit into from
Feb 9, 2022

Conversation

fsequeira1
Copy link
Contributor

@fsequeira1 fsequeira1 commented Feb 3, 2022

Related to: fluxcd/flux2#1024
This provider allows sending notifications to Grafana as annotations. To show the annotations on a dashboard there is a default tag (flux) that needs to be enabled.

Signed-off-by: Filipe Sequeira filipe@weave.works

@fsequeira1
Copy link
Contributor Author

Create Grafana provider and alert

apiVersion: notification.toolkit.fluxcd.io/v1beta1
kind: Provider
metadata:
  name: grafana
  namespace: flux-system
spec:
  type: grafana
  address: http://grafana.istio-system.svc.cluster.local/api/annotations
---
apiVersion: notification.toolkit.fluxcd.io/v1beta1
kind: Alert
metadata:
  name: test-grafana
  namespace: flux-system
spec:
  providerRef:
    name: grafana
  eventSeverity: info
  eventSources:
    - kind: GitRepository
      name: '*'
    - kind: Kustomization
      name: '*'
    - kind: HelmRelease
      name: '*'

how to enable annotations on a dashboard

Grafana dashboard settings

  • Annotations > Query > Match any
  • Annotations > Query > Tags (Add: flux)
    grafana configurations

##example
annotation example

Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @fsequeira1 thanks for your contribution. Can you please rebase with main and add grafana to the API docs provider table and also add an example in the alerts docs. The docs are here: https://github.com/fluxcd/notification-controller/tree/main/docs/spec/v1beta1

@stefanprodan stefanprodan added area/alerting Alerting related issues and PRs enhancement New feature or request labels Feb 4, 2022
@fsequeira1
Copy link
Contributor Author

Hello @stefanprodan. can you please confirm if it is ok now?

@stefanprodan
Copy link
Member

@fsequeira1 please rebase with upstream main and signoff your commits.

internal/notifier/factory.go Outdated Show resolved Hide resolved
internal/notifier/grafana.go Show resolved Hide resolved
docs/spec/v1beta1/provider.md Outdated Show resolved Hide resolved
docs/spec/v1beta1/provider.md Show resolved Hide resolved
@stefanprodan stefanprodan changed the title add grafana provider Add support for Grafana annotations API Feb 8, 2022
@stefanprodan
Copy link
Member

stefanprodan commented Feb 8, 2022

@fsequeira1 this looks great now. Can you squash all commits and force push a single signed commit please.

Signed-off-by: Filipe Sequeira <filipe@weave.works>
Co-authored-by: Stefan Prodan <stefan.prodan@gmail.com>
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @fsequeira1 🥇

@stefanprodan stefanprodan merged commit 0715fec into fluxcd:main Feb 9, 2022
@talaverant
Copy link

Great contribution @fsequeira1 ! Look forward to the prometheus provider 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/alerting Alerting related issues and PRs enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants