Commit Graph

37 Commits

Author SHA1 Message Date
Simon Pasquier bb1c123b7f
Merge pull request #3226 from an5t/telegram-token-file
Support loading Telegram bot token from file
2023-04-06 17:15:17 +02:00
Simon Rozet 41eb1213bb
support loading webhook URL from a file (#3223)
* support loading webhook URL from a file

/cc #2498

Signed-off-by: Simon Rozet <me@simonrozet.com>

* notify/webhook: add test for reading url from file

Signed-off-by: Simon Rozet <me@simonrozet.com>

* notify/pushover: add tests for reading secrets from files

Signed-off-by: Simon Rozet <me@simonrozet.com>

---------

Signed-off-by: Simon Rozet <me@simonrozet.com>
2023-03-03 15:31:14 +01:00
Andrey Mishakin 6c9c58015e Support loading Telegram bot token from file
Signed-off-by: Andrey Mishakin <stieroglif@gmail.com>
2023-01-22 16:35:01 +03:00
Simon Rozet a8e4c166a8
support loading pushover secrets from files (#3200)
* support loading pushover secrets from files

Add the user_key_file and token_file keys to the pushover config.

/cc https://github.com/prometheus/alertmanager/issues/2498

Signed-off-by: Simon Rozet <me@simonrozet.com>
2023-01-18 23:33:42 +01:00
gotjosh 907f7d3e80
Merge pull request #3132 from prometheus/webex-notifier
Notifier: Webex
2022-12-15 13:57:12 -04:00
gotjosh 572de996b7
Remove the `bot_token`
Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-12-15 11:48:01 -04:00
Erki Esken 9ae611329a
Add check for templated Opsgenie receiver config (#3060)
* Add check for templated Opsgenie receiver config

Solves #2887, where Opsgenie responder type can be templated according
to docs, but configuration logic checked for specific list of values only.

Signed-off-by: Erki Esken <erki@esken.net>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2022-12-07 22:13:03 +01:00
gotjosh ac0dc96127
A few changes to better align with what I know think it's the best setup in Webex Teams
- Move away from Webhook to APIRUL
- Make the Room ID a require field
- Set Authorization Credentails via Headers

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-11-09 20:07:54 +00:00
Oktarian T-B dd7214e51f
Add support for reading VictorOps API key from file (#3111)
* Read VictorOps API key from file

* Update documentation

* Improve tests

Signed-off-by: Oktarian T-B <oktariantilneybassett@improbable.io>
2022-10-25 15:40:17 +02:00
Oktarian T-B 1045dc0f21
Add support for reading PagerDuty secrets from files (#3107)
* Add support for reading PagerDuty secrets from files

* Update documentation

Signed-off-by: Oktarian Tilney-Bassett <oktariantilneybassett@improbable.io>
2022-10-14 14:55:59 +02:00
Oktarian T-B d034f116d5
Add PagerDuty source field (PD-CEF) (#3106)
* Add new source field to PD config
* Update documentation

Signed-off-by: Oktarian Tilney-Bassett <oktariantilneybassett@improbable.io>
2022-10-13 14:01:46 +02:00
Julien Pivotto 7c22040b8d
Merge pull request #3007 from prometheus/release-0.24
Release 0.24
2022-07-18 10:28:13 +02:00
Simon Pasquier 89de86fefc config: fix validation of OpsGenie configuration
The validation should fail if both `api_key` and `api_key_file` are
defined. I think there was a typo in the original PR (#2728) that
enforced `api_url` and `api_key_file` not being defined at the same
time.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-05-04 14:58:41 +02:00
Matthias Loibl a6d10bd5bc
Update golangci-lint and fix complaints (#2853)
* Copy latest golangci-lint files from Prometheus

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* Use grafana/regexp over stdlib regexp

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* Fix typos in comments

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* Fix goimports complains in import sorting

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* gofumpt all Go files

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* Update naming to comply with revive linter

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* config: Fix error messages to be lower case

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* test/cli: Fix error messages to be lower case

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* .golangci.yaml: Remove obsolete space

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* config: Fix expected victorOps error

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* Use stdlib regexp

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

* Clean up Go modules

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2022-03-25 17:59:51 +01:00
Simon Pasquier cd57dee6cd config: delegate Sigv4 validation to the inner type
This change also adds unit tests for SNS configuration.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-01-24 15:40:54 +01:00
Jason Cooper 277c9ed462
notify: add markdown support for wechat (#2309)
* notify: add markdown support for wechat

Signed-off-by: Jason Cooper <master@deamwork.com>

* docs: update WeChat receiver configuration document

Signed-off-by: Jason Cooper <master@deamwork.com>

* fix: check WeChat msgType, apply default if not present

Signed-off-by: Jason Cooper <master@deamwork.com>

* chore: remove unnecessary comment

Signed-off-by: Jason Cooper <master@deamwork.com>

* fix: simplify msgType process

Signed-off-by: Jason Cooper <master@deamwork.com>

* docs: wechat configs document update

Signed-off-by: Jason Cooper <master@deamwork.com>

* fix: apply error message suggestions

Signed-off-by: Jason Cooper <master@deamwork.com>

* test: add test for regex

Signed-off-by: Jason Cooper <master@deamwork.com>

* fix: wechat message safe param

Signed-off-by: Jason Cooper <master@deamwork.com>
2020-07-06 15:56:42 +02:00
Julien Pivotto 1cba0c7a37
Remove HipChat (#2281)
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-06-11 15:51:10 +02:00
Josh Soref 0f2c65d265 Spelling (#2167)
* spelling: inhibition

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: matchers

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: notification

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: nonexistent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: obfuscated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: occurred

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: relevant

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unexpected

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: marshaled

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: marshaling

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2020-01-23 17:06:16 +01:00
Asher Foa f45f870d2c Add the ability to configure slack markdown field (#1967)
* slack markdown field config

Signed-off-by: Asher Foa <asher@asherfoa.com>

* Add Test

Signed-off-by: Asher Foa <asher@asherfoa.com>

* remove empty lines

Signed-off-by: Asher Foa <asher@asherfoa.com>

* add empty line

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-07-31 12:04:59 +02:00
NODA, Kai fe4760ca75 config/notifiers.go: fix opsgenieValidTypesRe (#1910)
`^apple|banana|cherry$` finds matches to either of `^apple`, `banana`, or `cherry$`, so strings like `apple0`, `1banana2`, `3cherry` are accepted; I believe this wasn't intentional.

Signed-off-by: NODA, Kai <nodakai@gmail.com>
2019-06-17 11:05:38 +02:00
Simon Pasquier 0f754cdef3 config: fix Wechat global parameters (#1813)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-03-29 12:21:59 +01:00
Jason Roberts b02afcad63 Support adding custom fields to VictorOps notifications (#1420)
* Support adding custom fields to VictorOps notifications

* Response to feedback

* Added logic to validate victorops custom fields to config load time

* Cleanup victorops notifier of logic duplicated in config check

* rebase and further cleanup from feedback

* another grammer fix

Signed-off-by: Jason Roberts <jroberts@drud.com>
2019-01-15 11:59:05 +01:00
Arno Uhlig b63b560074 [notify/slack] Add name, value, SlackConfirmationField to slack action (#1557)
Signed-off-by: Arno Uhlig <arno.uhlig@sap.com>
2018-10-29 15:55:43 +01:00
Simon Pasquier 0ccc7c9f74 config: validate URLs at config load time (#1468)
* config: validate URLs at config load time

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Address Brian and Lucas comments

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Shallow copy of URL instead of reparsing it

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Unshadow net/url package

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Make a deep-copy of URL struct

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-07-26 12:39:33 +02:00
Simon Pasquier 2d3c4065e8 config: fix regression with Pager Duty (#1455)
The YAML strict mode doesn't allow mapping keys that are duplicates. If
someone wants to override one of the default keys in the Details hash,
the unmarshal function returns an error because the key is already
defined by DefaultPagerdutyConfig.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-07-05 09:54:28 +02:00
Simon Pasquier 0ebaeccd4b *: add missing license headers
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-05-14 17:37:13 +02:00
Trevor Wood cecfe5b2f5 Validate Slack field config and only allow the necessary input (#1334)
Signed-off-by: Trevor Wood <Trevor.G.Wood@gmail.com>
2018-04-25 18:58:11 +02:00
Manos Fokas 300a87e85b Removed file changes to resolve conflict. (#1318)
Signed-off-by: manosf <manosf@protonmail.com>
2018-04-17 16:22:46 +02:00
Simon Pasquier 8b93f1085d Add tests for HTTP client configuration 2018-02-13 14:30:59 +01:00
songjiayang d07a072b08 Fix WeChat issue (#1229)
* fix wechat issue

* wechat issue code review
2018-02-11 20:09:47 +01:00
Carlos Alexandro Becker c5ea346d06 allow global opsgenie api key (#1208)
* allow global opsgenie api key

* added missing files

* removed test
2018-01-29 16:05:17 +01:00
berlinsaint 6bab629590 Add notify support for Chinese User wechat (#1059)
* WECHAT support by ybyang2/berlinsaint

* correct the whitespace

* add some TestFile and modify some naming errors by ybyang2/berlinsaint

* modify wechat retry test expect

* template error

* add newline
Signed-off-by: yb_home <berlinsaint@126.com>

* fmt some pr code

* use the @stuartnelson3 the test-ci-wechat bingdata.go

* notify go add wechat
2017-12-09 16:20:22 +01:00
xginn8 266baa089c Adding check for webhook's URL formatting (#1129)
* Adding check for webhook's URL formatting
Since alertmanager will fail silently when trying to send to a schemaless URL, provide a way to check that a URL is properly formatted in alertmanager

* updating error message as requested
2017-12-07 15:01:16 +01:00
Jose Donizetti 7168749a9f Add test to missing pagerduty routing_key (#1097) 2017-11-12 11:38:01 -05:00
Steven Carvellas 5db8055bab Add support for PagerDuty API v2 (#1054) 2017-11-07 11:07:27 +01:00
Julius Volz 9b72c10134 Minor code cleanups 2017-11-01 23:08:34 +01:00
Jose Donizetti ae73a3103a Add tests to notifiers config (#1050) 2017-10-23 10:55:34 +02:00