Skip to content

Commit

Permalink
Update supported webhook version to 4
Browse files Browse the repository at this point in the history
Alertmanager 0.6 bumped webhook version from 3 to 4, update code and tests
  • Loading branch information
prymitive authored and mattbostock committed May 10, 2017
1 parent cb120dd commit 162379f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp"
)

const supportedWebhookVersion = "3"
const supportedWebhookVersion = "4"

var (
addr = "localhost:9097"
Expand Down
4 changes: 2 additions & 2 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ var amNotification = []byte(`{
},
"receiver": "alertmanager2es",
"status": "firing",
"version": "3",
"version": "4",
"groupKey": "{}/{}/{notify=\"default\":{alertname=\"Foo_Bar\", instance=\"foo\"}"
}`)

var esDocument = []byte(`{"alerts":[{"annotations":{"link":"https://example.com/Foo+Bar","summary":"Alert summary"},"endsAt":"0001-01-01T00:00:00Z","generatorURL":"https://example.com","labels":{"alertname":"Foo_Bar","instance":"foo"},"startsAt":"2017-02-02T16:51:13.507955756Z","status":"firing"}],"commonAnnotations":{"link":"https://example.com/Foo+Bar","summary":"Alert summary"},"commonLabels":{"alertname":"Foo_Bar","instance":"foo"},"externalURL":"https://alertmanager.example.com","groupLabels":{"alertname":"Foo_Bar"},"receiver":"alertmanager2es","status":"firing","version":"3","groupKey":"{}/{}/{notify=\"default\":{alertname=\"Foo_Bar\", instance=\"foo\"}","@timestamp":"2017-02-02T19:37:22+01:00"}`)
var esDocument = []byte(`{"alerts":[{"annotations":{"link":"https://example.com/Foo+Bar","summary":"Alert summary"},"endsAt":"0001-01-01T00:00:00Z","generatorURL":"https://example.com","labels":{"alertname":"Foo_Bar","instance":"foo"},"startsAt":"2017-02-02T16:51:13.507955756Z","status":"firing"}],"commonAnnotations":{"link":"https://example.com/Foo+Bar","summary":"Alert summary"},"commonLabels":{"alertname":"Foo_Bar","instance":"foo"},"externalURL":"https://alertmanager.example.com","groupLabels":{"alertname":"Foo_Bar"},"receiver":"alertmanager2es","status":"firing","version":"4","groupKey":"{}/{}/{notify=\"default\":{alertname=\"Foo_Bar\", instance=\"foo\"}","@timestamp":"2017-02-02T19:37:22+01:00"}`)

0 comments on commit 162379f

Please sign in to comment.