Change case of alert json to initial lower letter.

Matching change to what's on the prometheus server side.
This commit is contained in:
Brian Brazil 2015-05-30 14:37:26 +01:00
parent 6f0fa88489
commit 5de8fccdb4
3 changed files with 1131 additions and 1131 deletions

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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}}