-
Notifications
You must be signed in to change notification settings - Fork 253
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
integration: grafana 8.x support #2087
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionally validated both versions, and code looks great. One question - how did you come up with the versioning? Would it make sense to use the minimum granfana version e.g. 8
or 8.3.4
instead of 1
?
Grafana 8 added new alerting (v1), but they kept around the original alerting as "legacy alerts". So checking for version 1 in the webhook request just checks that it's sent in the new Grafana alert format. But, I believe you can still use the old alerts in grafana 8, but you need to opt-in and those alerts are slated to be removed in the future. That might be a good thing to comment though. |
@spencerpauly Ah I see, that makes total sense then, I just read too fast. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and working on my end 👍.
Description:
Adds support for Grafana 8.x webhooks. Fixes #2077
The new version supports multiple alerts in a single payload.
Details are generated via template, the summary is the
summary
annotation, falling back to thealertname
label and using thefingerprint
field for dedup.A README.md file has been added to the
grafana/
directory with documentation on testing the Grafana integration.Context:
Grafana 8 has changed the webhook payload compared to Grafana 7. Here's a comparison of the payloads for the alert firing event & ok event:
Grafana 7.1.4
"ok":
Grafana 8.x.x
"firing":
"ok":
This PR essentially checks the API "version" then reads the data in differently depending on the webhook format. To test this you'll want to install Grafana 8 and make an alert. @spencerpauly can help you set that up if you want.
Some things to test:
^ Would be best to test these cases in grafana 8 as-well as grafana 7