Change case of alert json to initial lower letter.
Matching change to what's on the prometheus server side.
This commit is contained in:
parent
6f0fa88489
commit
5de8fccdb4
|
@ -204,7 +204,7 @@ func (n *notifier) sendHipChatNotification(op notificationOp, config *pb.HipChat
|
|||
message = fmt.Sprintf("%s%s %s: %s", config.GetPrefix(), a.Labels["alertname"], status, a.Summary)
|
||||
messageFormat = "text"
|
||||
} else {
|
||||
message = fmt.Sprintf("%s<b>%s %s</b>: %s (<a href='%s'>view</a>)", config.GetPrefix(), html.EscapeString(a.Labels["alertname"]), status, html.EscapeString(a.Summary), a.Payload["GeneratorURL"])
|
||||
message = fmt.Sprintf("%s<b>%s %s</b>: %s (<a href='%s'>view</a>)", config.GetPrefix(), html.EscapeString(a.Labels["alertname"]), status, html.EscapeString(a.Summary), a.Payload["generatorURL"])
|
||||
messageFormat = "html"
|
||||
}
|
||||
buf, err := json.Marshal(map[string]interface{}{
|
||||
|
@ -287,10 +287,10 @@ func (n *notifier) sendSlackNotification(op notificationOp, config *pb.SlackConf
|
|||
}
|
||||
|
||||
attachment := &slackAttachment{
|
||||
Fallback: fmt.Sprintf("*%s %s*: %s (<%s|view>)", html.EscapeString(a.Labels["alertname"]), status, html.EscapeString(a.Summary), a.Payload["GeneratorURL"]),
|
||||
Fallback: fmt.Sprintf("*%s %s*: %s (<%s|view>)", html.EscapeString(a.Labels["alertname"]), status, html.EscapeString(a.Summary), a.Payload["generatorURL"]),
|
||||
Pretext: fmt.Sprintf("*%s*", html.EscapeString(a.Labels["alertname"])),
|
||||
Title: html.EscapeString(a.Summary),
|
||||
TitleLink: a.Payload["GeneratorURL"],
|
||||
TitleLink: a.Payload["generatorURL"],
|
||||
Text: html.EscapeString(a.Description),
|
||||
Color: color,
|
||||
MrkdwnIn: []string{"fallback", "pretext"},
|
||||
|
@ -376,8 +376,8 @@ func newFlowdockMessage(op notificationOp, config *pb.FlowdockConfig, a *Alert)
|
|||
FromAddress: config.GetFromAddress(),
|
||||
Subject: html.EscapeString(a.Summary),
|
||||
Format: "html",
|
||||
Content: fmt.Sprintf("*%s %s*: %s (<%s|view>)", html.EscapeString(a.Labels["alertname"]), status, html.EscapeString(a.Summary), a.Payload["GeneratorURL"]),
|
||||
Link: a.Payload["GeneratorURL"],
|
||||
Content: fmt.Sprintf("*%s %s*: %s (<%s|view>)", html.EscapeString(a.Labels["alertname"]), status, html.EscapeString(a.Summary), a.Payload["generatorURL"]),
|
||||
Link: a.Payload["generatorURL"],
|
||||
Tags: append(config.GetTag(), status),
|
||||
}
|
||||
return msg
|
||||
|
|
2246
web/blob/files.go
2246
web/blob/files.go
File diff suppressed because it is too large
Load Diff
|
@ -47,11 +47,11 @@
|
|||
<td>{{timeSince .Created}} ago</td>
|
||||
<td>{{timeSince .LastRefreshed}} ago</td>
|
||||
<td>
|
||||
{{if .Alert.Payload.GeneratorURL}}
|
||||
<a href="{{.Alert.Payload.GeneratorURL}}">{{(truncate .Alert.Payload.GeneratorURL 40)}}</a>
|
||||
{{if .Alert.Payload.generatorURL}}
|
||||
<a href="{{.Alert.Payload.generatorURL}}">{{(truncate .Alert.Payload.generatorURL 40)}}</a>
|
||||
{{end}}
|
||||
</td>
|
||||
<td>{{.Alert.Payload.AlertingRule}}</td>
|
||||
<td>{{.Alert.Payload.alertingRule}}</td>
|
||||
<td>
|
||||
{{$silence := call $silenceForAlert .Alert}}
|
||||
{{if $silence}}
|
||||
|
|
Loading…
Reference in New Issue