File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -60,24 +60,24 @@ func inputHandler(client *alamos.Client, debug bool) http.Handler {
6060 severity := alert .Labels ["severity" ]
6161 switch strings .ToUpper (severity ) {
6262 case "PAGE" :
63- var alertText string
63+ var alertMessage string
6464 alertData := make (map [string ]string )
6565
6666 description , ok := alert .Annotations ["description" ]
6767 if ok {
68- alertText = description
68+ alertData [ "keyword" ] = description
6969 } else {
70- alertText = alert .Labels ["alertname" ]
70+ alertData [ "keyword" ] = alert .Labels ["alertname" ]
7171 }
7272
7373 summary , ok := alert .Annotations ["summary" ]
7474 if ok {
75- alertData [ "keyword" ] = summary
75+ alertMessage = summary
7676 } else {
77- alertData [ "keyword" ] = fmt .Sprintf ("Instance: %s" , alert .Labels ["instance" ])
77+ alertMessage = fmt .Sprintf ("Instance: %s" , alert .Labels ["instance" ])
7878 }
7979
80- err := client .SendAlert (alertText , alertData )
80+ err := client .SendAlert (alertMessage , alertData )
8181 if err != nil {
8282 w .WriteHeader (http .StatusInternalServerError )
8383 w .Write ([]byte ("ERROR" ))
You can’t perform that action at this time.
0 commit comments