mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-21 03:16:00 -08:00
Change case of alert json to initial lower letter.
This is more in line with common practice, and with the webhook in alertmanager this will be more directly exposed to users.
This commit is contained in:
parent
f34de493d5
commit
75e8b48c87
|
@ -143,14 +143,14 @@ func (n *NotificationHandler) sendNotifications(reqs NotificationReqs) error {
|
|||
alerts := make([]map[string]interface{}, 0, len(reqs))
|
||||
for _, req := range reqs {
|
||||
alerts = append(alerts, map[string]interface{}{
|
||||
"Summary": req.Summary,
|
||||
"Description": req.Description,
|
||||
"Labels": req.Labels,
|
||||
"Payload": map[string]interface{}{
|
||||
"Value": req.Value,
|
||||
"ActiveSince": req.ActiveSince,
|
||||
"GeneratorURL": req.GeneratorURL,
|
||||
"AlertingRule": req.RuleString,
|
||||
"summary": req.Summary,
|
||||
"description": req.Description,
|
||||
"labels": req.Labels,
|
||||
"payload": map[string]interface{}{
|
||||
"value": req.Value,
|
||||
"activeSince": req.ActiveSince,
|
||||
"generatorURL": req.GeneratorURL,
|
||||
"alertingRule": req.RuleString,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ func TestNotificationHandler(t *testing.T) {
|
|||
// Correct message.
|
||||
summary: "Summary",
|
||||
description: "Description",
|
||||
message: `[{"Description":"Description","Labels":{"instance":"testinstance"},"Payload":{"ActiveSince":"0001-01-01T00:00:00Z","AlertingRule":"Test rule string","GeneratorURL":"prometheus_url","Value":"0.3333333333333333"},"Summary":"Summary"}]`,
|
||||
message: `[{"description":"Description","labels":{"instance":"testinstance"},"payload":{"activeSince":"0001-01-01T00:00:00Z","alertingRule":"Test rule string","generatorURL":"prometheus_url","value":"0.3333333333333333"},"summary":"Summary"}]`,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue