We recently migrated from Grafana 6.7.4 to Grafana 8.3.3. We are using our own webhook for notification channel as we enrich the alerts from Grafana with some meta information before passing to Opsgenie. We noticed that with Grafana 6.7.4 the webhook test notification setting used to test if notification channel is fine generated the below JSON payload
{
dashboardId: 1,
evalMatches: [
{ value: 100, metric: 'High value', tags: null },
{ value: 200, metric: 'Higher Value', tags: null }
],
message: 'Someone is testing the alert notification within Grafana.',
orgId: 0,
panelId: 1,
ruleId: 0,
ruleName: 'Test notification',
ruleUrl: 'http://grafana.staged-by-discourse.com/',
state: 'alerting',
tags: {},
title: '[Alerting] Test notification'
}
While handling this payload we used condition of ruleID = 0 as test notification and ignore it. Post migrating to Grafana 8.3.3 we see this payload is changed to something like:
{
"title": "[Alerting] Test notification",
"ruleId": 1559729022103063253,
"ruleName": "Test notification",
"state": "alerting",
"evalMatches": [
{
"value": 100,
"metric": "High value",
"tags": null
},
{
"value": 200,
"metric": "Higher Value",
"tags": null
}
],
"orgId": 0,
"dashboardId": 1,
"panelId": 1,
"tags": {},
"ruleUrl": "https://grafana.xxxxxxxxx.com/",
"message": "Someone is testing the alert notification within Grafana."
}
The value of ruleID is not consistent & it keeps throwing random values. Is this expected behaviour? How can we uniquely identify this alert for testing of alert notification?
Note: We don’t have the unified alerting or opt-in features enabled for 8.3.3