mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Fix silence url in notifications (#46031)
* Update silence url generation * Update tests * Update test to the new silence params format * Fix tests
This commit is contained in:
parent
bc26d42980
commit
aeec087065
@ -99,7 +99,7 @@ Labels:
|
|||||||
Annotations:
|
Annotations:
|
||||||
- ann1 = annv1
|
- ann1 = annv1
|
||||||
Source: http://localhost/alert1
|
Source: http://localhost/alert1
|
||||||
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1
|
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1
|
||||||
Dashboard: http://localhost/grafana/d/dbuid123
|
Dashboard: http://localhost/grafana/d/dbuid123
|
||||||
Panel: http://localhost/grafana/d/dbuid123?viewPanel=puid123
|
Panel: http://localhost/grafana/d/dbuid123?viewPanel=puid123
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ Labels:
|
|||||||
Annotations:
|
Annotations:
|
||||||
- ann1 = annv2
|
- ann1 = annv2
|
||||||
Source: http://localhost/alert2
|
Source: http://localhost/alert2
|
||||||
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval2
|
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval2
|
||||||
|
|
||||||
|
|
||||||
**Resolved**
|
**Resolved**
|
||||||
@ -122,7 +122,7 @@ Labels:
|
|||||||
Annotations:
|
Annotations:
|
||||||
- ann1 = annv3
|
- ann1 = annv3
|
||||||
Source: http://localhost/alert3
|
Source: http://localhost/alert3
|
||||||
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval3
|
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval3
|
||||||
Dashboard: http://localhost/grafana/d/dbuid456
|
Dashboard: http://localhost/grafana/d/dbuid456
|
||||||
Panel: http://localhost/grafana/d/dbuid456?viewPanel=puid456
|
Panel: http://localhost/grafana/d/dbuid456?viewPanel=puid456
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ Labels:
|
|||||||
Annotations:
|
Annotations:
|
||||||
- ann1 = annv4
|
- ann1 = annv4
|
||||||
Source: http://localhost/alert4
|
Source: http://localhost/alert4
|
||||||
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval4
|
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval4
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -150,7 +150,7 @@ Annotations:
|
|||||||
|
|
||||||
Source: http://localhost/alert1
|
Source: http://localhost/alert1
|
||||||
|
|
||||||
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1
|
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1
|
||||||
|
|
||||||
Dashboard: http://localhost/grafana/d/dbuid123
|
Dashboard: http://localhost/grafana/d/dbuid123
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ Annotations:
|
|||||||
|
|
||||||
Source: http://localhost/alert2
|
Source: http://localhost/alert2
|
||||||
|
|
||||||
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval2
|
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ Annotations:
|
|||||||
|
|
||||||
Source: http://localhost/alert3
|
Source: http://localhost/alert3
|
||||||
|
|
||||||
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval3
|
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval3
|
||||||
|
|
||||||
Dashboard: http://localhost/grafana/d/dbuid456
|
Dashboard: http://localhost/grafana/d/dbuid456
|
||||||
|
|
||||||
@ -203,7 +203,7 @@ Annotations:
|
|||||||
|
|
||||||
Source: http://localhost/alert4
|
Source: http://localhost/alert4
|
||||||
|
|
||||||
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval4
|
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval4
|
||||||
|
|
||||||
|
|
||||||
`,
|
`,
|
||||||
|
@ -44,7 +44,7 @@ func TestDingdingNotifier(t *testing.T) {
|
|||||||
"msgtype": "link",
|
"msgtype": "link",
|
||||||
"link": map[string]interface{}{
|
"link": map[string]interface{}{
|
||||||
"messageUrl": "dingtalk://dingtalkclient/page/link?pc_slide=false&url=http%3A%2F%2Flocalhost%2Falerting%2Flist",
|
"messageUrl": "dingtalk://dingtalkclient/page/link?pc_slide=false&url=http%3A%2F%2Flocalhost%2Falerting%2Flist",
|
||||||
"text": "**Firing**\n\nValue: 1234\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
"text": "**Firing**\n\nValue: 1234\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
||||||
"title": "[FIRING:1] (val1)",
|
"title": "[FIRING:1] (val1)",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -43,7 +43,7 @@ func TestDiscordNotifier(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
expMsg: map[string]interface{}{
|
expMsg: map[string]interface{}{
|
||||||
"content": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
"content": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
||||||
"embeds": []interface{}{map[string]interface{}{
|
"embeds": []interface{}{map[string]interface{}{
|
||||||
"color": 1.4037554e+07,
|
"color": 1.4037554e+07,
|
||||||
"footer": map[string]interface{}{
|
"footer": map[string]interface{}{
|
||||||
@ -123,7 +123,7 @@ func TestDiscordNotifier(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
expMsg: map[string]interface{}{
|
expMsg: map[string]interface{}{
|
||||||
"content": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
"content": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
||||||
"embeds": []interface{}{map[string]interface{}{
|
"embeds": []interface{}{map[string]interface{}{
|
||||||
"color": 1.4037554e+07,
|
"color": 1.4037554e+07,
|
||||||
"footer": map[string]interface{}{
|
"footer": map[string]interface{}{
|
||||||
|
@ -90,7 +90,7 @@ func TestEmailNotifier(t *testing.T) {
|
|||||||
Labels: template.KV{"alertname": "AlwaysFiring", "severity": "warning"},
|
Labels: template.KV{"alertname": "AlwaysFiring", "severity": "warning"},
|
||||||
Annotations: template.KV{"runbook_url": "http://fix.me"},
|
Annotations: template.KV{"runbook_url": "http://fix.me"},
|
||||||
Fingerprint: "15a37193dce72bab",
|
Fingerprint: "15a37193dce72bab",
|
||||||
SilenceURL: "http://localhost/base/alerting/silence/new?alertmanager=grafana&matchers=alertname%3DAlwaysFiring%2Cseverity%3Dwarning",
|
SilenceURL: "http://localhost/base/alerting/silence/new?alertmanager=grafana&matcher=alertname%3DAlwaysFiring&matcher=severity%3Dwarning",
|
||||||
DashboardURL: "http://localhost/base/d/abc",
|
DashboardURL: "http://localhost/base/d/abc",
|
||||||
PanelURL: "http://localhost/base/d/abc?viewPanel=5",
|
PanelURL: "http://localhost/base/d/abc?viewPanel=5",
|
||||||
},
|
},
|
||||||
|
@ -58,7 +58,7 @@ func TestGoogleChatNotifier(t *testing.T) {
|
|||||||
Widgets: []widget{
|
Widgets: []widget{
|
||||||
textParagraphWidget{
|
textParagraphWidget{
|
||||||
Text: text{
|
Text: text{
|
||||||
Text: "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
Text: "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
buttonWidget{
|
buttonWidget{
|
||||||
@ -117,7 +117,7 @@ func TestGoogleChatNotifier(t *testing.T) {
|
|||||||
Widgets: []widget{
|
Widgets: []widget{
|
||||||
textParagraphWidget{
|
textParagraphWidget{
|
||||||
Text: text{
|
Text: text{
|
||||||
Text: "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val2\nAnnotations:\n - ann1 = annv2\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval2\n",
|
Text: "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val2\nAnnotations:\n - ann1 = annv2\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval2\n",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
buttonWidget{
|
buttonWidget{
|
||||||
|
@ -51,7 +51,7 @@ func TestKafkaNotifier(t *testing.T) {
|
|||||||
"client": "Grafana",
|
"client": "Grafana",
|
||||||
"client_url": "http://localhost/alerting/list",
|
"client_url": "http://localhost/alerting/list",
|
||||||
"description": "[FIRING:1] (val1)",
|
"description": "[FIRING:1] (val1)",
|
||||||
"details": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
"details": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
||||||
"incident_key": "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733"
|
"incident_key": "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -86,7 +86,7 @@ func TestKafkaNotifier(t *testing.T) {
|
|||||||
"client": "Grafana",
|
"client": "Grafana",
|
||||||
"client_url": "http://localhost/alerting/list",
|
"client_url": "http://localhost/alerting/list",
|
||||||
"description": "[FIRING:2] ",
|
"description": "[FIRING:2] ",
|
||||||
"details": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val2\nAnnotations:\n - ann1 = annv2\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval2\n",
|
"details": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val2\nAnnotations:\n - ann1 = annv2\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval2\n",
|
||||||
"incident_key": "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733"
|
"incident_key": "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ func TestLineNotifier(t *testing.T) {
|
|||||||
"Authorization": "Bearer sometoken",
|
"Authorization": "Bearer sometoken",
|
||||||
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||||
},
|
},
|
||||||
expMsg: "message=%5BFIRING%3A1%5D++%28val1%29%0Ahttp%3A%2Flocalhost%2Falerting%2Flist%0A%0A%2A%2AFiring%2A%2A%0A%0AValue%3A+%5Bno+value%5D%0ALabels%3A%0A+-+alertname+%3D+alert1%0A+-+lbl1+%3D+val1%0AAnnotations%3A%0A+-+ann1+%3D+annv1%0ASilence%3A+http%3A%2F%2Flocalhost%2Falerting%2Fsilence%2Fnew%3Falertmanager%3Dgrafana%26matchers%3Dalertname%253Dalert1%252Clbl1%253Dval1%0ADashboard%3A+http%3A%2F%2Flocalhost%2Fd%2Fabcd%0APanel%3A+http%3A%2F%2Flocalhost%2Fd%2Fabcd%3FviewPanel%3Defgh%0A",
|
expMsg: "message=%5BFIRING%3A1%5D++%28val1%29%0Ahttp%3A%2Flocalhost%2Falerting%2Flist%0A%0A%2A%2AFiring%2A%2A%0A%0AValue%3A+%5Bno+value%5D%0ALabels%3A%0A+-+alertname+%3D+alert1%0A+-+lbl1+%3D+val1%0AAnnotations%3A%0A+-+ann1+%3D+annv1%0ASilence%3A+http%3A%2F%2Flocalhost%2Falerting%2Fsilence%2Fnew%3Falertmanager%3Dgrafana%26matcher%3Dalertname%253Dalert1%26matcher%3Dlbl1%253Dval1%0ADashboard%3A+http%3A%2F%2Flocalhost%2Fd%2Fabcd%0APanel%3A+http%3A%2F%2Flocalhost%2Fd%2Fabcd%3FviewPanel%3Defgh%0A",
|
||||||
expMsgError: nil,
|
expMsgError: nil,
|
||||||
}, {
|
}, {
|
||||||
name: "Multiple alerts",
|
name: "Multiple alerts",
|
||||||
@ -68,7 +68,7 @@ func TestLineNotifier(t *testing.T) {
|
|||||||
"Authorization": "Bearer sometoken",
|
"Authorization": "Bearer sometoken",
|
||||||
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||||
},
|
},
|
||||||
expMsg: "message=%5BFIRING%3A2%5D++%0Ahttp%3A%2Flocalhost%2Falerting%2Flist%0A%0A%2A%2AFiring%2A%2A%0A%0AValue%3A+%5Bno+value%5D%0ALabels%3A%0A+-+alertname+%3D+alert1%0A+-+lbl1+%3D+val1%0AAnnotations%3A%0A+-+ann1+%3D+annv1%0ASilence%3A+http%3A%2F%2Flocalhost%2Falerting%2Fsilence%2Fnew%3Falertmanager%3Dgrafana%26matchers%3Dalertname%253Dalert1%252Clbl1%253Dval1%0A%0AValue%3A+%5Bno+value%5D%0ALabels%3A%0A+-+alertname+%3D+alert1%0A+-+lbl1+%3D+val2%0AAnnotations%3A%0A+-+ann1+%3D+annv2%0ASilence%3A+http%3A%2F%2Flocalhost%2Falerting%2Fsilence%2Fnew%3Falertmanager%3Dgrafana%26matchers%3Dalertname%253Dalert1%252Clbl1%253Dval2%0A",
|
expMsg: "message=%5BFIRING%3A2%5D++%0Ahttp%3A%2Flocalhost%2Falerting%2Flist%0A%0A%2A%2AFiring%2A%2A%0A%0AValue%3A+%5Bno+value%5D%0ALabels%3A%0A+-+alertname+%3D+alert1%0A+-+lbl1+%3D+val1%0AAnnotations%3A%0A+-+ann1+%3D+annv1%0ASilence%3A+http%3A%2F%2Flocalhost%2Falerting%2Fsilence%2Fnew%3Falertmanager%3Dgrafana%26matcher%3Dalertname%253Dalert1%26matcher%3Dlbl1%253Dval1%0A%0AValue%3A+%5Bno+value%5D%0ALabels%3A%0A+-+alertname+%3D+alert1%0A+-+lbl1+%3D+val2%0AAnnotations%3A%0A+-+ann1+%3D+annv2%0ASilence%3A+http%3A%2F%2Flocalhost%2Falerting%2Fsilence%2Fnew%3Falertmanager%3Dgrafana%26matcher%3Dalertname%253Dalert1%26matcher%3Dlbl1%253Dval2%0A",
|
||||||
expMsgError: nil,
|
expMsgError: nil,
|
||||||
}, {
|
}, {
|
||||||
name: "Token missing",
|
name: "Token missing",
|
||||||
|
@ -44,7 +44,7 @@ func TestOpsgenieNotifier(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expMsg: `{
|
expMsg: `{
|
||||||
"alias": "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733",
|
"alias": "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733",
|
||||||
"description": "[FIRING:1] (val1)\nhttp://localhost/alerting/list\n\n**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
"description": "[FIRING:1] (val1)\nhttp://localhost/alerting/list\n\n**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
||||||
"details": {
|
"details": {
|
||||||
"url": "http://localhost/alerting/list"
|
"url": "http://localhost/alerting/list"
|
||||||
},
|
},
|
||||||
@ -69,7 +69,7 @@ func TestOpsgenieNotifier(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expMsg: `{
|
expMsg: `{
|
||||||
"alias": "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733",
|
"alias": "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733",
|
||||||
"description": "[FIRING:1] (val1)\nhttp://localhost/alerting/list\n\n**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\n",
|
"description": "[FIRING:1] (val1)\nhttp://localhost/alerting/list\n\n**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\n",
|
||||||
"details": {
|
"details": {
|
||||||
"url": "http://localhost/alerting/list"
|
"url": "http://localhost/alerting/list"
|
||||||
},
|
},
|
||||||
@ -94,7 +94,7 @@ func TestOpsgenieNotifier(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expMsg: `{
|
expMsg: `{
|
||||||
"alias": "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733",
|
"alias": "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733",
|
||||||
"description": "[FIRING:1] (val1)\nhttp://localhost/alerting/list\n\n**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\n",
|
"description": "[FIRING:1] (val1)\nhttp://localhost/alerting/list\n\n**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\n",
|
||||||
"details": {
|
"details": {
|
||||||
"alertname": "alert1",
|
"alertname": "alert1",
|
||||||
"lbl1": "val1",
|
"lbl1": "val1",
|
||||||
@ -126,7 +126,7 @@ func TestOpsgenieNotifier(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expMsg: `{
|
expMsg: `{
|
||||||
"alias": "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733",
|
"alias": "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733",
|
||||||
"description": "[FIRING:2] \nhttp://localhost/alerting/list\n\n**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val2\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval2\n",
|
"description": "[FIRING:2] \nhttp://localhost/alerting/list\n\n**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val2\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval2\n",
|
||||||
"details": {
|
"details": {
|
||||||
"alertname": "alert1",
|
"alertname": "alert1",
|
||||||
"url": "http://localhost/alerting/list"
|
"url": "http://localhost/alerting/list"
|
||||||
|
@ -59,7 +59,7 @@ func TestPagerdutyNotifier(t *testing.T) {
|
|||||||
Component: "Grafana",
|
Component: "Grafana",
|
||||||
Group: "default",
|
Group: "default",
|
||||||
CustomDetails: map[string]string{
|
CustomDetails: map[string]string{
|
||||||
"firing": "\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
"firing": "\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
||||||
"num_firing": "1",
|
"num_firing": "1",
|
||||||
"num_resolved": "0",
|
"num_resolved": "0",
|
||||||
"resolved": "",
|
"resolved": "",
|
||||||
@ -105,7 +105,7 @@ func TestPagerdutyNotifier(t *testing.T) {
|
|||||||
Component: "My Grafana",
|
Component: "My Grafana",
|
||||||
Group: "my_group",
|
Group: "my_group",
|
||||||
CustomDetails: map[string]string{
|
CustomDetails: map[string]string{
|
||||||
"firing": "\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val2\nAnnotations:\n - ann1 = annv2\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval2\n",
|
"firing": "\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val2\nAnnotations:\n - ann1 = annv2\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval2\n",
|
||||||
"num_firing": "2",
|
"num_firing": "2",
|
||||||
"num_resolved": "0",
|
"num_resolved": "0",
|
||||||
"resolved": "",
|
"resolved": "",
|
||||||
|
@ -59,7 +59,7 @@ func TestPushoverNotifier(t *testing.T) {
|
|||||||
"title": "[FIRING:1] (val1)",
|
"title": "[FIRING:1] (val1)",
|
||||||
"url": "http://localhost/alerting/list",
|
"url": "http://localhost/alerting/list",
|
||||||
"url_title": "Show alert rule",
|
"url_title": "Show alert rule",
|
||||||
"message": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
"message": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
||||||
"html": "1",
|
"html": "1",
|
||||||
},
|
},
|
||||||
expMsgError: nil,
|
expMsgError: nil,
|
||||||
|
@ -60,7 +60,7 @@ func TestSensuGoNotifier(t *testing.T) {
|
|||||||
"ruleURL": "http://localhost/alerting/list",
|
"ruleURL": "http://localhost/alerting/list",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"output": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
"output": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
||||||
"issued": timeNow().Unix(),
|
"issued": timeNow().Unix(),
|
||||||
"interval": 86400,
|
"interval": 86400,
|
||||||
"status": 2,
|
"status": 2,
|
||||||
|
@ -59,7 +59,7 @@ func TestSlackNotifier(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Title: "[FIRING:1] (val1)",
|
Title: "[FIRING:1] (val1)",
|
||||||
TitleLink: "http://localhost/alerting/list",
|
TitleLink: "http://localhost/alerting/list",
|
||||||
Text: "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
Text: "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
||||||
Fallback: "[FIRING:1] (val1)",
|
Fallback: "[FIRING:1] (val1)",
|
||||||
Fields: nil,
|
Fields: nil,
|
||||||
Footer: "Grafana v" + setting.BuildVersion,
|
Footer: "Grafana v" + setting.BuildVersion,
|
||||||
@ -94,7 +94,7 @@ func TestSlackNotifier(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Title: "[FIRING:1] (val1)",
|
Title: "[FIRING:1] (val1)",
|
||||||
TitleLink: "http://localhost/alerting/list",
|
TitleLink: "http://localhost/alerting/list",
|
||||||
Text: "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\n",
|
Text: "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\n",
|
||||||
Fallback: "[FIRING:1] (val1)",
|
Fallback: "[FIRING:1] (val1)",
|
||||||
Fields: nil,
|
Fields: nil,
|
||||||
Footer: "Grafana v" + setting.BuildVersion,
|
Footer: "Grafana v" + setting.BuildVersion,
|
||||||
@ -136,7 +136,7 @@ func TestSlackNotifier(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Title: "2 firing, 0 resolved",
|
Title: "2 firing, 0 resolved",
|
||||||
TitleLink: "http://localhost/alerting/list",
|
TitleLink: "http://localhost/alerting/list",
|
||||||
Text: "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val2\nAnnotations:\n - ann1 = annv2\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval2\n",
|
Text: "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val2\nAnnotations:\n - ann1 = annv2\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval2\n",
|
||||||
Fallback: "2 firing, 0 resolved",
|
Fallback: "2 firing, 0 resolved",
|
||||||
Fields: nil,
|
Fields: nil,
|
||||||
Footer: "Grafana v" + setting.BuildVersion,
|
Footer: "Grafana v" + setting.BuildVersion,
|
||||||
@ -184,7 +184,7 @@ func TestSlackNotifier(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Title: "[FIRING:1] (val1)",
|
Title: "[FIRING:1] (val1)",
|
||||||
TitleLink: "http://localhost/alerting/list",
|
TitleLink: "http://localhost/alerting/list",
|
||||||
Text: "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\n",
|
Text: "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\n",
|
||||||
Fallback: "[FIRING:1] (val1)",
|
Fallback: "[FIRING:1] (val1)",
|
||||||
Fields: nil,
|
Fields: nil,
|
||||||
Footer: "Grafana v" + setting.BuildVersion,
|
Footer: "Grafana v" + setting.BuildVersion,
|
||||||
|
@ -49,7 +49,7 @@ func TestTeamsNotifier(t *testing.T) {
|
|||||||
"sections": []map[string]interface{}{
|
"sections": []map[string]interface{}{
|
||||||
{
|
{
|
||||||
"title": "Details",
|
"title": "Details",
|
||||||
"text": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
"text": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"potentialAction": []map[string]interface{}{
|
"potentialAction": []map[string]interface{}{
|
||||||
|
@ -48,7 +48,7 @@ func TestTelegramNotifier(t *testing.T) {
|
|||||||
expMsg: map[string]string{
|
expMsg: map[string]string{
|
||||||
"chat_id": "someid",
|
"chat_id": "someid",
|
||||||
"parse_mode": "html",
|
"parse_mode": "html",
|
||||||
"text": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSource: a URL\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
"text": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSource: a URL\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
||||||
},
|
},
|
||||||
expMsgError: nil,
|
expMsgError: nil,
|
||||||
}, {
|
}, {
|
||||||
@ -75,7 +75,7 @@ func TestTelegramNotifier(t *testing.T) {
|
|||||||
expMsg: map[string]string{
|
expMsg: map[string]string{
|
||||||
"chat_id": "someid",
|
"chat_id": "someid",
|
||||||
"parse_mode": "html",
|
"parse_mode": "html",
|
||||||
"text": "__Custom Firing__\n2 Firing\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSource: a URL\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val2\nAnnotations:\n - ann1 = annv2\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval2\n",
|
"text": "__Custom Firing__\n2 Firing\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSource: a URL\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val2\nAnnotations:\n - ann1 = annv2\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval2\n",
|
||||||
},
|
},
|
||||||
expMsgError: nil,
|
expMsgError: nil,
|
||||||
}, {
|
}, {
|
||||||
|
@ -99,7 +99,15 @@ func extendAlert(alert template.Alert, externalURL string, logger log.Logger) *E
|
|||||||
}
|
}
|
||||||
sort.Strings(matchers)
|
sort.Strings(matchers)
|
||||||
u.Path = path.Join(externalPath, "/alerting/silence/new")
|
u.Path = path.Join(externalPath, "/alerting/silence/new")
|
||||||
u.RawQuery = "alertmanager=grafana&matchers=" + url.QueryEscape(strings.Join(matchers, ","))
|
|
||||||
|
query := make(url.Values)
|
||||||
|
query.Add("alertmanager", "grafana")
|
||||||
|
for _, matcher := range matchers {
|
||||||
|
query.Add("matcher", matcher)
|
||||||
|
}
|
||||||
|
|
||||||
|
u.RawQuery = query.Encode()
|
||||||
|
|
||||||
extended.SilenceURL = u.String()
|
extended.SilenceURL = u.String()
|
||||||
|
|
||||||
return extended
|
return extended
|
||||||
|
@ -45,7 +45,7 @@ func TestThreemaNotifier(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
expMsg: "from=%2A1234567&secret=supersecret&text=%E2%9A%A0%EF%B8%8F+%5BFIRING%3A1%5D++%28val1%29%0A%0A%2AMessage%3A%2A%0A%2A%2AFiring%2A%2A%0A%0AValue%3A+%5Bno+value%5D%0ALabels%3A%0A+-+alertname+%3D+alert1%0A+-+lbl1+%3D+val1%0AAnnotations%3A%0A+-+ann1+%3D+annv1%0ASilence%3A+http%3A%2F%2Flocalhost%2Falerting%2Fsilence%2Fnew%3Falertmanager%3Dgrafana%26matchers%3Dalertname%253Dalert1%252Clbl1%253Dval1%0ADashboard%3A+http%3A%2F%2Flocalhost%2Fd%2Fabcd%0APanel%3A+http%3A%2F%2Flocalhost%2Fd%2Fabcd%3FviewPanel%3Defgh%0A%0A%2AURL%3A%2A+http%3A%2Flocalhost%2Falerting%2Flist%0A&to=87654321",
|
expMsg: "from=%2A1234567&secret=supersecret&text=%E2%9A%A0%EF%B8%8F+%5BFIRING%3A1%5D++%28val1%29%0A%0A%2AMessage%3A%2A%0A%2A%2AFiring%2A%2A%0A%0AValue%3A+%5Bno+value%5D%0ALabels%3A%0A+-+alertname+%3D+alert1%0A+-+lbl1+%3D+val1%0AAnnotations%3A%0A+-+ann1+%3D+annv1%0ASilence%3A+http%3A%2F%2Flocalhost%2Falerting%2Fsilence%2Fnew%3Falertmanager%3Dgrafana%26matcher%3Dalertname%253Dalert1%26matcher%3Dlbl1%253Dval1%0ADashboard%3A+http%3A%2F%2Flocalhost%2Fd%2Fabcd%0APanel%3A+http%3A%2F%2Flocalhost%2Fd%2Fabcd%3FviewPanel%3Defgh%0A%0A%2AURL%3A%2A+http%3A%2Flocalhost%2Falerting%2Flist%0A&to=87654321",
|
||||||
expMsgError: nil,
|
expMsgError: nil,
|
||||||
}, {
|
}, {
|
||||||
name: "Multiple alerts",
|
name: "Multiple alerts",
|
||||||
@ -67,7 +67,7 @@ func TestThreemaNotifier(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
expMsg: "from=%2A1234567&secret=supersecret&text=%E2%9A%A0%EF%B8%8F+%5BFIRING%3A2%5D++%0A%0A%2AMessage%3A%2A%0A%2A%2AFiring%2A%2A%0A%0AValue%3A+%5Bno+value%5D%0ALabels%3A%0A+-+alertname+%3D+alert1%0A+-+lbl1+%3D+val1%0AAnnotations%3A%0A+-+ann1+%3D+annv1%0ASilence%3A+http%3A%2F%2Flocalhost%2Falerting%2Fsilence%2Fnew%3Falertmanager%3Dgrafana%26matchers%3Dalertname%253Dalert1%252Clbl1%253Dval1%0A%0AValue%3A+%5Bno+value%5D%0ALabels%3A%0A+-+alertname+%3D+alert1%0A+-+lbl1+%3D+val2%0AAnnotations%3A%0A+-+ann1+%3D+annv2%0ASilence%3A+http%3A%2F%2Flocalhost%2Falerting%2Fsilence%2Fnew%3Falertmanager%3Dgrafana%26matchers%3Dalertname%253Dalert1%252Clbl1%253Dval2%0A%0A%2AURL%3A%2A+http%3A%2Flocalhost%2Falerting%2Flist%0A&to=87654321",
|
expMsg: "from=%2A1234567&secret=supersecret&text=%E2%9A%A0%EF%B8%8F+%5BFIRING%3A2%5D++%0A%0A%2AMessage%3A%2A%0A%2A%2AFiring%2A%2A%0A%0AValue%3A+%5Bno+value%5D%0ALabels%3A%0A+-+alertname+%3D+alert1%0A+-+lbl1+%3D+val1%0AAnnotations%3A%0A+-+ann1+%3D+annv1%0ASilence%3A+http%3A%2F%2Flocalhost%2Falerting%2Fsilence%2Fnew%3Falertmanager%3Dgrafana%26matcher%3Dalertname%253Dalert1%26matcher%3Dlbl1%253Dval1%0A%0AValue%3A+%5Bno+value%5D%0ALabels%3A%0A+-+alertname+%3D+alert1%0A+-+lbl1+%3D+val2%0AAnnotations%3A%0A+-+ann1+%3D+annv2%0ASilence%3A+http%3A%2F%2Flocalhost%2Falerting%2Fsilence%2Fnew%3Falertmanager%3Dgrafana%26matcher%3Dalertname%253Dalert1%26matcher%3Dlbl1%253Dval2%0A%0A%2AURL%3A%2A+http%3A%2Flocalhost%2Falerting%2Flist%0A&to=87654321",
|
||||||
expMsgError: nil,
|
expMsgError: nil,
|
||||||
}, {
|
}, {
|
||||||
name: "Invalid gateway id",
|
name: "Invalid gateway id",
|
||||||
|
@ -47,7 +47,7 @@ func TestVictoropsNotifier(t *testing.T) {
|
|||||||
"entity_id": "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733",
|
"entity_id": "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733",
|
||||||
"message_type": "CRITICAL",
|
"message_type": "CRITICAL",
|
||||||
"monitoring_tool": "Grafana v" + setting.BuildVersion,
|
"monitoring_tool": "Grafana v" + setting.BuildVersion,
|
||||||
"state_message": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
"state_message": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
||||||
},
|
},
|
||||||
expMsgError: nil,
|
expMsgError: nil,
|
||||||
}, {
|
}, {
|
||||||
@ -72,7 +72,7 @@ func TestVictoropsNotifier(t *testing.T) {
|
|||||||
"entity_id": "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733",
|
"entity_id": "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733",
|
||||||
"message_type": "CRITICAL",
|
"message_type": "CRITICAL",
|
||||||
"monitoring_tool": "Grafana v" + setting.BuildVersion,
|
"monitoring_tool": "Grafana v" + setting.BuildVersion,
|
||||||
"state_message": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val2\nAnnotations:\n - ann1 = annv2\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval2\n",
|
"state_message": "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val2\nAnnotations:\n - ann1 = annv2\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval2\n",
|
||||||
},
|
},
|
||||||
expMsgError: nil,
|
expMsgError: nil,
|
||||||
}, {
|
}, {
|
||||||
|
@ -68,7 +68,7 @@ func TestWebhookNotifier(t *testing.T) {
|
|||||||
Fingerprint: "fac0861a85de433a",
|
Fingerprint: "fac0861a85de433a",
|
||||||
DashboardURL: "http://localhost/d/abcd",
|
DashboardURL: "http://localhost/d/abcd",
|
||||||
PanelURL: "http://localhost/d/abcd?viewPanel=efgh",
|
PanelURL: "http://localhost/d/abcd?viewPanel=efgh",
|
||||||
SilenceURL: "http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1",
|
SilenceURL: "http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
GroupLabels: template.KV{
|
GroupLabels: template.KV{
|
||||||
@ -87,7 +87,7 @@ func TestWebhookNotifier(t *testing.T) {
|
|||||||
GroupKey: "alertname",
|
GroupKey: "alertname",
|
||||||
Title: "[FIRING:1] (val1)",
|
Title: "[FIRING:1] (val1)",
|
||||||
State: "alerting",
|
State: "alerting",
|
||||||
Message: "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
Message: "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n",
|
||||||
OrgID: orgID,
|
OrgID: orgID,
|
||||||
},
|
},
|
||||||
expMsgError: nil,
|
expMsgError: nil,
|
||||||
@ -137,7 +137,7 @@ func TestWebhookNotifier(t *testing.T) {
|
|||||||
"ann1": "annv1",
|
"ann1": "annv1",
|
||||||
},
|
},
|
||||||
Fingerprint: "fac0861a85de433a",
|
Fingerprint: "fac0861a85de433a",
|
||||||
SilenceURL: "http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1",
|
SilenceURL: "http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1",
|
||||||
}, {
|
}, {
|
||||||
Status: "firing",
|
Status: "firing",
|
||||||
Labels: template.KV{
|
Labels: template.KV{
|
||||||
@ -148,7 +148,7 @@ func TestWebhookNotifier(t *testing.T) {
|
|||||||
"ann1": "annv2",
|
"ann1": "annv2",
|
||||||
},
|
},
|
||||||
Fingerprint: "fab6861a85d5eeb5",
|
Fingerprint: "fab6861a85d5eeb5",
|
||||||
SilenceURL: "http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval2",
|
SilenceURL: "http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval2",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
GroupLabels: template.KV{
|
GroupLabels: template.KV{
|
||||||
@ -165,7 +165,7 @@ func TestWebhookNotifier(t *testing.T) {
|
|||||||
TruncatedAlerts: 1,
|
TruncatedAlerts: 1,
|
||||||
Title: "[FIRING:2] ",
|
Title: "[FIRING:2] ",
|
||||||
State: "alerting",
|
State: "alerting",
|
||||||
Message: "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val2\nAnnotations:\n - ann1 = annv2\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval2\n",
|
Message: "**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val2\nAnnotations:\n - ann1 = annv2\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval2\n",
|
||||||
OrgID: orgID,
|
OrgID: orgID,
|
||||||
},
|
},
|
||||||
expMsgError: nil,
|
expMsgError: nil,
|
||||||
|
@ -45,7 +45,7 @@ func TestWeComNotifier(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expMsg: map[string]interface{}{
|
expMsg: map[string]interface{}{
|
||||||
"markdown": map[string]interface{}{
|
"markdown": map[string]interface{}{
|
||||||
"content": "# [FIRING:1] (val1)\n**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matchers=alertname%3Dalert1%2Clbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n\n",
|
"content": "# [FIRING:1] (val1)\n**Firing**\n\nValue: [no value]\nLabels:\n - alertname = alert1\n - lbl1 = val1\nAnnotations:\n - ann1 = annv1\nSilence: http://localhost/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1\nDashboard: http://localhost/d/abcd\nPanel: http://localhost/d/abcd?viewPanel=efgh\n\n",
|
||||||
},
|
},
|
||||||
"msgtype": "markdown",
|
"msgtype": "markdown",
|
||||||
},
|
},
|
||||||
|
@ -2099,7 +2099,7 @@ var expEmailNotifications = []*models.SendEmailCommandSync{
|
|||||||
EndsAt: time.Time{},
|
EndsAt: time.Time{},
|
||||||
GeneratorURL: "http://localhost:3000/alerting/UID_EmailAlert/edit",
|
GeneratorURL: "http://localhost:3000/alerting/UID_EmailAlert/edit",
|
||||||
Fingerprint: "08c220aa26cd0cf5",
|
Fingerprint: "08c220aa26cd0cf5",
|
||||||
SilenceURL: "http://localhost:3000/alerting/silence/new?alertmanager=grafana&matchers=alertname%3DEmailAlert",
|
SilenceURL: "http://localhost:3000/alerting/silence/new?alertmanager=grafana&matcher=alertname%3DEmailAlert",
|
||||||
DashboardURL: "",
|
DashboardURL: "",
|
||||||
PanelURL: "",
|
PanelURL: "",
|
||||||
ValueString: "[ var='A' labels={} value=1 ]",
|
ValueString: "[ var='A' labels={} value=1 ]",
|
||||||
@ -2157,7 +2157,7 @@ var expNonEmailNotifications = map[string][]string{
|
|||||||
{
|
{
|
||||||
"title": "[FIRING:1] SlackAlert2 ",
|
"title": "[FIRING:1] SlackAlert2 ",
|
||||||
"title_link": "http://localhost:3000/alerting/list",
|
"title_link": "http://localhost:3000/alerting/list",
|
||||||
"text": "**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = SlackAlert2\nAnnotations:\nSource: http://localhost:3000/alerting/UID_SlackAlert2/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matchers=alertname%%3DSlackAlert2\n",
|
"text": "**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = SlackAlert2\nAnnotations:\nSource: http://localhost:3000/alerting/UID_SlackAlert2/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matcher=alertname%%3DSlackAlert2\n",
|
||||||
"fallback": "[FIRING:1] SlackAlert2 ",
|
"fallback": "[FIRING:1] SlackAlert2 ",
|
||||||
"footer": "Grafana v",
|
"footer": "Grafana v",
|
||||||
"footer_icon": "https://grafana.com/assets/img/fav32.png",
|
"footer_icon": "https://grafana.com/assets/img/fav32.png",
|
||||||
@ -2190,7 +2190,7 @@ var expNonEmailNotifications = map[string][]string{
|
|||||||
"component": "Integration Test",
|
"component": "Integration Test",
|
||||||
"group": "testgroup",
|
"group": "testgroup",
|
||||||
"custom_details": {
|
"custom_details": {
|
||||||
"firing": "\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = PagerdutyAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_PagerdutyAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matchers=alertname%%3DPagerdutyAlert\n",
|
"firing": "\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = PagerdutyAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_PagerdutyAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matcher=alertname%%3DPagerdutyAlert\n",
|
||||||
"num_firing": "1",
|
"num_firing": "1",
|
||||||
"num_resolved": "0",
|
"num_resolved": "0",
|
||||||
"resolved": ""
|
"resolved": ""
|
||||||
@ -2210,7 +2210,7 @@ var expNonEmailNotifications = map[string][]string{
|
|||||||
`{
|
`{
|
||||||
"link": {
|
"link": {
|
||||||
"messageUrl": "dingtalk://dingtalkclient/page/link?pc_slide=false&url=http%3A%2F%2Flocalhost%3A3000%2Falerting%2Flist",
|
"messageUrl": "dingtalk://dingtalkclient/page/link?pc_slide=false&url=http%3A%2F%2Flocalhost%3A3000%2Falerting%2Flist",
|
||||||
"text": "**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = DingDingAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_DingDingAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matchers=alertname%3DDingDingAlert\n",
|
"text": "**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = DingDingAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_DingDingAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matcher=alertname%3DDingDingAlert\n",
|
||||||
"title": "[FIRING:1] DingDingAlert "
|
"title": "[FIRING:1] DingDingAlert "
|
||||||
},
|
},
|
||||||
"msgtype": "link"
|
"msgtype": "link"
|
||||||
@ -2235,7 +2235,7 @@ var expNonEmailNotifications = map[string][]string{
|
|||||||
],
|
],
|
||||||
"sections": [
|
"sections": [
|
||||||
{
|
{
|
||||||
"text": "**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = TeamsAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_TeamsAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matchers=alertname%3DTeamsAlert\n",
|
"text": "**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = TeamsAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_TeamsAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matcher=alertname%3DTeamsAlert\n",
|
||||||
"title": "Details"
|
"title": "Details"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -2261,7 +2261,7 @@ var expNonEmailNotifications = map[string][]string{
|
|||||||
"endsAt": "0001-01-01T00:00:00Z",
|
"endsAt": "0001-01-01T00:00:00Z",
|
||||||
"generatorURL": "http://localhost:3000/alerting/UID_WebhookAlert/edit",
|
"generatorURL": "http://localhost:3000/alerting/UID_WebhookAlert/edit",
|
||||||
"fingerprint": "929467973978d053",
|
"fingerprint": "929467973978d053",
|
||||||
"silenceURL": "http://localhost:3000/alerting/silence/new?alertmanager=grafana&matchers=alertname%%3DWebhookAlert",
|
"silenceURL": "http://localhost:3000/alerting/silence/new?alertmanager=grafana&matcher=alertname%%3DWebhookAlert",
|
||||||
"dashboardURL": "",
|
"dashboardURL": "",
|
||||||
"panelURL": ""
|
"panelURL": ""
|
||||||
}
|
}
|
||||||
@ -2279,12 +2279,12 @@ var expNonEmailNotifications = map[string][]string{
|
|||||||
"truncatedAlerts": 0,
|
"truncatedAlerts": 0,
|
||||||
"title": "[FIRING:1] WebhookAlert ",
|
"title": "[FIRING:1] WebhookAlert ",
|
||||||
"state": "alerting",
|
"state": "alerting",
|
||||||
"message": "**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = WebhookAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_WebhookAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matchers=alertname%%3DWebhookAlert\n"
|
"message": "**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = WebhookAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_WebhookAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matcher=alertname%%3DWebhookAlert\n"
|
||||||
}`,
|
}`,
|
||||||
},
|
},
|
||||||
"discord_recv/discord_test": {
|
"discord_recv/discord_test": {
|
||||||
`{
|
`{
|
||||||
"content": "**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = DiscordAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_DiscordAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matchers=alertname%3DDiscordAlert\n",
|
"content": "**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = DiscordAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_DiscordAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matcher=alertname%3DDiscordAlert\n",
|
||||||
"embeds": [
|
"embeds": [
|
||||||
{
|
{
|
||||||
"color": 14037554,
|
"color": 14037554,
|
||||||
@ -2312,7 +2312,7 @@ var expNonEmailNotifications = map[string][]string{
|
|||||||
},
|
},
|
||||||
"name": "default"
|
"name": "default"
|
||||||
},
|
},
|
||||||
"output": "**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = SensuGoAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_SensuGoAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matchers=alertname%%3DSensuGoAlert\n",
|
"output": "**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = SensuGoAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_SensuGoAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matcher=alertname%%3DSensuGoAlert\n",
|
||||||
"status": 2
|
"status": 2
|
||||||
},
|
},
|
||||||
"entity": {
|
"entity": {
|
||||||
@ -2325,10 +2325,10 @@ var expNonEmailNotifications = map[string][]string{
|
|||||||
}`,
|
}`,
|
||||||
},
|
},
|
||||||
"pushover_recv/pushover_test": {
|
"pushover_recv/pushover_test": {
|
||||||
"--abcd\r\nContent-Disposition: form-data; name=\"user\"\r\n\r\nmysecretkey\r\n--abcd\r\nContent-Disposition: form-data; name=\"token\"\r\n\r\nmysecrettoken\r\n--abcd\r\nContent-Disposition: form-data; name=\"priority\"\r\n\r\n0\r\n--abcd\r\nContent-Disposition: form-data; name=\"sound\"\r\n\r\n\r\n--abcd\r\nContent-Disposition: form-data; name=\"title\"\r\n\r\n[FIRING:1] PushoverAlert \r\n--abcd\r\nContent-Disposition: form-data; name=\"url\"\r\n\r\nhttp://localhost:3000/alerting/list\r\n--abcd\r\nContent-Disposition: form-data; name=\"url_title\"\r\n\r\nShow alert rule\r\n--abcd\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\n**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = PushoverAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_PushoverAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matchers=alertname%3DPushoverAlert\n\r\n--abcd\r\nContent-Disposition: form-data; name=\"html\"\r\n\r\n1\r\n--abcd--\r\n",
|
"--abcd\r\nContent-Disposition: form-data; name=\"user\"\r\n\r\nmysecretkey\r\n--abcd\r\nContent-Disposition: form-data; name=\"token\"\r\n\r\nmysecrettoken\r\n--abcd\r\nContent-Disposition: form-data; name=\"priority\"\r\n\r\n0\r\n--abcd\r\nContent-Disposition: form-data; name=\"sound\"\r\n\r\n\r\n--abcd\r\nContent-Disposition: form-data; name=\"title\"\r\n\r\n[FIRING:1] PushoverAlert \r\n--abcd\r\nContent-Disposition: form-data; name=\"url\"\r\n\r\nhttp://localhost:3000/alerting/list\r\n--abcd\r\nContent-Disposition: form-data; name=\"url_title\"\r\n\r\nShow alert rule\r\n--abcd\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\n**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = PushoverAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_PushoverAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matcher=alertname%3DPushoverAlert\n\r\n--abcd\r\nContent-Disposition: form-data; name=\"html\"\r\n\r\n1\r\n--abcd--\r\n",
|
||||||
},
|
},
|
||||||
"telegram_recv/bot6sh027hs034h": {
|
"telegram_recv/bot6sh027hs034h": {
|
||||||
"--abcd\r\nContent-Disposition: form-data; name=\"chat_id\"\r\n\r\ntelegram_chat_id\r\n--abcd\r\nContent-Disposition: form-data; name=\"parse_mode\"\r\n\r\nhtml\r\n--abcd\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = TelegramAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_TelegramAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matchers=alertname%3DTelegramAlert\n\r\n--abcd--\r\n",
|
"--abcd\r\nContent-Disposition: form-data; name=\"chat_id\"\r\n\r\ntelegram_chat_id\r\n--abcd\r\nContent-Disposition: form-data; name=\"parse_mode\"\r\n\r\nhtml\r\n--abcd\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = TelegramAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_TelegramAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matcher=alertname%3DTelegramAlert\n\r\n--abcd--\r\n",
|
||||||
},
|
},
|
||||||
"googlechat_recv/googlechat_test": {
|
"googlechat_recv/googlechat_test": {
|
||||||
`{
|
`{
|
||||||
@ -2344,7 +2344,7 @@ var expNonEmailNotifications = map[string][]string{
|
|||||||
"widgets": [
|
"widgets": [
|
||||||
{
|
{
|
||||||
"textParagraph": {
|
"textParagraph": {
|
||||||
"text": "**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = GoogleChatAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_GoogleChatAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matchers=alertname%%3DGoogleChatAlert\n"
|
"text": "**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = GoogleChatAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_GoogleChatAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matcher=alertname%%3DGoogleChatAlert\n"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -2382,7 +2382,7 @@ var expNonEmailNotifications = map[string][]string{
|
|||||||
"client": "Grafana",
|
"client": "Grafana",
|
||||||
"client_url": "http://localhost:3000/alerting/list",
|
"client_url": "http://localhost:3000/alerting/list",
|
||||||
"description": "[FIRING:1] KafkaAlert ",
|
"description": "[FIRING:1] KafkaAlert ",
|
||||||
"details": "**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = KafkaAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_KafkaAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matchers=alertname%3DKafkaAlert\n",
|
"details": "**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = KafkaAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_KafkaAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matcher=alertname%3DKafkaAlert\n",
|
||||||
"incident_key": "35c0bdb1715f9162a20d7b2a01cb2e3a4c5b1dc663571701e3f67212b696332f"
|
"incident_key": "35c0bdb1715f9162a20d7b2a01cb2e3a4c5b1dc663571701e3f67212b696332f"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2390,10 +2390,10 @@ var expNonEmailNotifications = map[string][]string{
|
|||||||
}`,
|
}`,
|
||||||
},
|
},
|
||||||
"line_recv/line_test": {
|
"line_recv/line_test": {
|
||||||
`message=%5BFIRING%3A1%5D+LineAlert+%0Ahttp%3A%2Flocalhost%3A3000%2Falerting%2Flist%0A%0A%2A%2AFiring%2A%2A%0A%0AValue%3A+%5B+var%3D%27A%27+labels%3D%7B%7D+value%3D1+%5D%0ALabels%3A%0A+-+alertname+%3D+LineAlert%0AAnnotations%3A%0ASource%3A+http%3A%2F%2Flocalhost%3A3000%2Falerting%2FUID_LineAlert%2Fedit%0ASilence%3A+http%3A%2F%2Flocalhost%3A3000%2Falerting%2Fsilence%2Fnew%3Falertmanager%3Dgrafana%26matchers%3Dalertname%253DLineAlert%0A`,
|
`message=%5BFIRING%3A1%5D+LineAlert+%0Ahttp%3A%2Flocalhost%3A3000%2Falerting%2Flist%0A%0A%2A%2AFiring%2A%2A%0A%0AValue%3A+%5B+var%3D%27A%27+labels%3D%7B%7D+value%3D1+%5D%0ALabels%3A%0A+-+alertname+%3D+LineAlert%0AAnnotations%3A%0ASource%3A+http%3A%2F%2Flocalhost%3A3000%2Falerting%2FUID_LineAlert%2Fedit%0ASilence%3A+http%3A%2F%2Flocalhost%3A3000%2Falerting%2Fsilence%2Fnew%3Falertmanager%3Dgrafana%26matcher%3Dalertname%253DLineAlert%0A`,
|
||||||
},
|
},
|
||||||
"threema_recv/threema_test": {
|
"threema_recv/threema_test": {
|
||||||
`from=%2A1234567&secret=myapisecret&text=%E2%9A%A0%EF%B8%8F+%5BFIRING%3A1%5D+ThreemaAlert+%0A%0A%2AMessage%3A%2A%0A%2A%2AFiring%2A%2A%0A%0AValue%3A+%5B+var%3D%27A%27+labels%3D%7B%7D+value%3D1+%5D%0ALabels%3A%0A+-+alertname+%3D+ThreemaAlert%0AAnnotations%3A%0ASource%3A+http%3A%2F%2Flocalhost%3A3000%2Falerting%2FUID_ThreemaAlert%2Fedit%0ASilence%3A+http%3A%2F%2Flocalhost%3A3000%2Falerting%2Fsilence%2Fnew%3Falertmanager%3Dgrafana%26matchers%3Dalertname%253DThreemaAlert%0A%0A%2AURL%3A%2A+http%3A%2Flocalhost%3A3000%2Falerting%2Flist%0A&to=abcdefgh`,
|
`from=%2A1234567&secret=myapisecret&text=%E2%9A%A0%EF%B8%8F+%5BFIRING%3A1%5D+ThreemaAlert+%0A%0A%2AMessage%3A%2A%0A%2A%2AFiring%2A%2A%0A%0AValue%3A+%5B+var%3D%27A%27+labels%3D%7B%7D+value%3D1+%5D%0ALabels%3A%0A+-+alertname+%3D+ThreemaAlert%0AAnnotations%3A%0ASource%3A+http%3A%2F%2Flocalhost%3A3000%2Falerting%2FUID_ThreemaAlert%2Fedit%0ASilence%3A+http%3A%2F%2Flocalhost%3A3000%2Falerting%2Fsilence%2Fnew%3Falertmanager%3Dgrafana%26matcher%3Dalertname%253DThreemaAlert%0A%0A%2AURL%3A%2A+http%3A%2Flocalhost%3A3000%2Falerting%2Flist%0A&to=abcdefgh`,
|
||||||
},
|
},
|
||||||
"victorops_recv/victorops_test": {
|
"victorops_recv/victorops_test": {
|
||||||
`{
|
`{
|
||||||
@ -2402,14 +2402,14 @@ var expNonEmailNotifications = map[string][]string{
|
|||||||
"entity_id": "633ae988fa7074bcb51f3d1c5fef2ba1c5c4ccb45b3ecbf681f7d507b078b1ae",
|
"entity_id": "633ae988fa7074bcb51f3d1c5fef2ba1c5c4ccb45b3ecbf681f7d507b078b1ae",
|
||||||
"message_type": "CRITICAL",
|
"message_type": "CRITICAL",
|
||||||
"monitoring_tool": "Grafana v",
|
"monitoring_tool": "Grafana v",
|
||||||
"state_message": "**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = VictorOpsAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_VictorOpsAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matchers=alertname%%3DVictorOpsAlert\n",
|
"state_message": "**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = VictorOpsAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_VictorOpsAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matcher=alertname%%3DVictorOpsAlert\n",
|
||||||
"timestamp": %s
|
"timestamp": %s
|
||||||
}`,
|
}`,
|
||||||
},
|
},
|
||||||
"opsgenie_recv/opsgenie_test": {
|
"opsgenie_recv/opsgenie_test": {
|
||||||
`{
|
`{
|
||||||
"alias": "47e92f0f6ef9fe99f3954e0d6155f8d09c4b9a038d8c3105e82c0cee4c62956e",
|
"alias": "47e92f0f6ef9fe99f3954e0d6155f8d09c4b9a038d8c3105e82c0cee4c62956e",
|
||||||
"description": "[FIRING:1] OpsGenieAlert \nhttp://localhost:3000/alerting/list\n\n**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = OpsGenieAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_OpsGenieAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matchers=alertname%3DOpsGenieAlert\n",
|
"description": "[FIRING:1] OpsGenieAlert \nhttp://localhost:3000/alerting/list\n\n**Firing**\n\nValue: [ var='A' labels={} value=1 ]\nLabels:\n - alertname = OpsGenieAlert\nAnnotations:\nSource: http://localhost:3000/alerting/UID_OpsGenieAlert/edit\nSilence: http://localhost:3000/alerting/silence/new?alertmanager=grafana&matcher=alertname%3DOpsGenieAlert\n",
|
||||||
"details": {
|
"details": {
|
||||||
"url": "http://localhost:3000/alerting/list"
|
"url": "http://localhost:3000/alerting/list"
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user