Notifier for HipChat broken in Alertmanager 0.15.1
What did you do? running AM v0.15.1 to test
What did you expect to see? The request URL towards HipChat server (on premise) as in 0.15.0: POST /v2/room/0000/notification?auth_token=xxxxxxxxxXXXXXXXXXXxxxxxxxxxXXXXXXXXXXXX HTTP/1.1
What did you see instead? Under which circumstances? Request in 0.15.1: POST /v2/room/0000/notification%3Fauth_token=xxxxxxxxxXXXXXXXXXXxxxxxxxxxXXXXXXXXXXXX HTTP/1.1 -->> which results in a HTTP 404 response code from HipChat server
it seems that this behaviour is caused by changing the url typed as string to url.URL
changing as follows in notify/impl.go did fix the issue
- apiURL.Path += fmt.Sprintf("v2/room/%s/notification?auth_token=%s", roomid, n.conf.AuthToken)
+ apiURL.Path += fmt.Sprintf("v2/room/%s/notification", roomid)
+ q := apiURL.Query()
+ q.Set("auth_token", fmt.Sprintf("%s", n.conf.AuthToken))
+ apiURL.RawQuery = q.Encode()
@simonpasquier Looks like the ? introducing the query string is being escaped as part of the Path
Thanks a lot @andrekully for the detailed bug report!
The new release contains the fix: https://github.com/prometheus/alertmanager/releases/tag/v0.15.2