alertmanager/notify
Benoît Knecht 59a96579cc
notify/pagerduty: Filter out empty images and links (#2379)
PagerDuty Event API v2 [1] requires images to have an `src` property, and links
to have an `href` property.

This commit filters out images and links that don't satisfy those conditions,
to avoid getting an HTTP 400 error in response.

This also adds flexibilty when using templates to configure images and links,
as it's now possible to omit images or links by letting the template return an
empty string for the `src` or `href` property, respectively.

[1]: https://developer.pagerduty.com/docs/events-api-v2/trigger-events/#context-properties

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
2020-09-25 17:31:22 +02:00
..
email Add email notify Message-Id Header (#2057) 2019-10-23 15:49:30 +02:00
opsgenie Update common (#2353) 2020-08-25 15:48:59 +02:00
pagerduty notify/pagerduty: Filter out empty images and links (#2379) 2020-09-25 17:31:22 +02:00
pushover Update common (#2353) 2020-08-25 15:48:59 +02:00
slack Update common (#2353) 2020-08-25 15:48:59 +02:00
test *: split notify package 2019-06-18 15:36:19 +02:00
victorops Update common (#2353) 2020-08-25 15:48:59 +02:00
webhook Update common (#2353) 2020-08-25 15:48:59 +02:00
wechat Update common (#2353) 2020-08-25 15:48:59 +02:00
notify.go notify: always retry with a back-off (#2290) 2020-06-16 09:50:35 +02:00
notify_test.go notify: don't use the global metrics registry (#1977) 2019-08-26 16:37:13 +02:00
util.go notify: refactor code to retry requests (#1974) 2019-08-02 16:17:40 +02:00
util_test.go notify: refactor code to retry requests (#1974) 2019-08-02 16:17:40 +02:00