Merge pull request #751 from prometheus/alert-json-case

Change case of alert json to initial lower letter.
This commit is contained in:
Brian Brazil 2015-06-01 14:13:53 +01:00
commit cf65f2df0a
2 changed files with 9 additions and 9 deletions

View File

@ -143,14 +143,14 @@ func (n *NotificationHandler) sendNotifications(reqs NotificationReqs) error {
alerts := make([]map[string]interface{}, 0, len(reqs)) alerts := make([]map[string]interface{}, 0, len(reqs))
for _, req := range reqs { for _, req := range reqs {
alerts = append(alerts, map[string]interface{}{ alerts = append(alerts, map[string]interface{}{
"Summary": req.Summary, "summary": req.Summary,
"Description": req.Description, "description": req.Description,
"Labels": req.Labels, "labels": req.Labels,
"Payload": map[string]interface{}{ "payload": map[string]interface{}{
"Value": req.Value, "value": req.Value,
"ActiveSince": req.ActiveSince, "activeSince": req.ActiveSince,
"GeneratorURL": req.GeneratorURL, "generatorURL": req.GeneratorURL,
"AlertingRule": req.RuleString, "alertingRule": req.RuleString,
}, },
}) })
} }

View File

@ -81,7 +81,7 @@ func TestNotificationHandler(t *testing.T) {
// Correct message. // Correct message.
summary: "Summary", summary: "Summary",
description: "Description", 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"}]`,
}, },
} }