Commit Graph

29 Commits

Author SHA1 Message Date
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
Eric R. Rath efc956c7f7
SMTP config: add global and local password file fields (#3038)
* SMTP config: add global and local password file fields

Add config fields (for both global email config and route-specific email
config) that specify path to file containing SMTP password.  We don't
want the password in the config file itself, and reading the password
from a k8s-secret-backed file keeps the password itself "encrypted at
rest" in etcd, and cleanly separated from the rest of the AM config.

I used the same approach as pull request #2534 "Add support to set the
Slack URL in the file"
<https://github.com/prometheus/alertmanager/pull/2534/files> in the
upstream repo.

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* changed *AuthPasswordFile field types to string per review feedback

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* added error to getPassword() retval per review feedback

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* simplified conf.smtp-* files

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* update docs to reflect field type change

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* don't treat username-without-password as invalid

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* test cleanup

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* Apply suggestions from code review

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Eric R. Rath <4080262+ericrrath@users.noreply.github.com>

* Updated per review feedback

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* added sub-test per review feedback

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* added test on Email.getPassword() per feedback

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* only inherit global SMTP passwords if neither local password field is set

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* removed blank line caught by gofumpt

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>
Signed-off-by: Eric R. Rath <4080262+ericrrath@users.noreply.github.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2022-09-16 14:36:57 +02:00
Simon Pasquier 48a99764a1
*: bump to Go 1.17 (#2792)
* *: bump to Go 1.17

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

* *: fix yamllint errors

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2021-12-22 14:03:53 +01:00
Jan-Otto Kröpke 186362cef0
Implement opsgenie_api_key_file (#2728)
Signed-off-by: Jan-Otto Kröpke <joe@adorsys.de>
2021-10-21 09:29:03 +02:00
Tyler Reid 51b93681b2 Revert "Add sigv4 as a global config option"
This reverts commit 4c2a5f156c.

Signed-off-by: Tyler Reid <tyler.reid@grafana.com>
2021-07-09 09:33:05 -05:00
Tyler Reid 4c2a5f156c Add sigv4 as a global config option
Signed-off-by: Tyler Reid <tyler.reid@grafana.com>
2021-07-07 18:45:58 -05:00
Tyler Reid 6519c399b1 Add some tests for sns receiver
Signed-off-by: Tyler Reid <tyler.reid@grafana.com>
2021-06-14 22:14:12 -05:00
Tyler Reid 74d15273c0 Add support for role arn, truncation, dedupe key and env auth
Signed-off-by: Tyler Reid <tyler.reid@grafana.com>
2021-06-11 16:21:15 -05:00
Tyler Reid 19e74f9ce7 WIP - SNS receiver
Signed-off-by: Tyler Reid <tyler.reid@grafana.com>
2021-06-09 21:14:07 -05:00
Julien Duchesne f33427c96e Updated docs. Fixed YAML newlines
Signed-off-by: Julien Duchesne <julien.duchesne@grafana.com>
2021-04-13 10:59:15 -04:00
Julien Duchesne 59c7fd5053 Add support to set the Slack URL in a file
- Added support for the file in both the global and the lower level
- Tried to follow configuration patterns I saw in prometheus
- The slack file is read on every request as mentioned in the prometheus issue to enable seamless switches

https://github.com/prometheus/alertmanager/issues/2498
Signed-off-by: Julien Duchesne <julien.duchesne@grafana.com>
2021-04-01 21:59:49 -04:00
Julien Pivotto b4e000c6c2 Update common
- Add support for custom authorization scheme
- Add support for not following redirects in http_client

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2021-03-01 23:19:38 +01: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
Simon Pasquier 0630b38c4a
config: forbid nil regexp matchers (#2083)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-10-25 11:44:45 +02:00
Bartek Płotka 9ddc5f1348 opsgenie: Moved from deprecated, non documented teams to responders field. (#1863)
Teams config option will fail unmarshalling as it is deprecated.

Fixes https://github.com/prometheus/alertmanager/issues/1818

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
2019-05-13 14:51:26 +02:00
stuart nelson 6a0be9eaa2 Add image_url to example of good config
There was a report that this isn't working.
Updating the config and ensuring the parsing works
correctly indicates that the image_url is being
read into a string.

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2019-05-06 10:51:14 +02:00
Hrishikesh Barman 4e424e3cd6 config: Change DefaultGlobalConfig to a function (#1656)
The variable DefaultGlobalConfig was being used to initialize values, but it stored previous information due to which some things were persisting in the newer initialization.

In this PR, DefaultGlobalConfig is changed to a function so that it returns a fresh GlobalConfig for initialization.

Signed-off-by: Hrishikesh Barman <hrishikeshbman@gmail.com>
2019-01-15 18:03:45 +01:00
kirillsablin 32bb289906 dispatch: Add group_by_all support (#1588)
To aggregate by all possible labels use '...' as the sole label name. 
This effectively disables aggregation entirely, passing through all 
alerts as-is. This is unlikely to be what you want, unless you have 
a very low alert volume or your upstream notification system performs 
its own grouping. Example: group_by: [...]

Signed-off-by: Kyryl Sablin <kyryl.sablin@schibsted.com>
2018-11-29 12:31:14 +01:00
Simon Pasquier ce2f2ac380 config: enforce HTTP or HTTPS URLs (#1567)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-10-05 19:29:52 +02: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
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
Jose Donizetti 76c15a0ef5 Fix config name inconsistency (#1087)
* Rename global config hipchat_url to hipchat_api_url

* Rename opsgenie config 'host' to 'url'
2017-11-11 15:01:21 +01:00
Steven Carvellas 5db8055bab Add support for PagerDuty API v2 (#1054) 2017-11-07 11:07:27 +01:00
ideaship a566036015 Support for custom SMTP hello string (#892)
* Support for custom SMTP hello string

Some MTAs insist that they be greeted with a fully qualified domain
name. The default provided by the net/smtp library, "HELLO localhost",
is not sufficient and will result in rejected messages.

This changeset adds a new configuration option that allows the
alertmanager to do its job in such an environment.

* Test SMTPHello parsing
2017-07-18 09:32:57 +02:00
Carlos Alexandro Becker ca8d73a59b Added possibility to have a global victorops api_key (#897)
* Added possibility to have a global victorops api_key

* adding tests for victorops default key
2017-07-12 09:25:47 +02:00
Conor Broderick b5ad65fa32 Omit empty config fields and show regex upon re-marshalling to elide secrets (#864)
* Omit empty config fields upon remarshalling to elide secrets

* added test checking for empty or null fields and blank regexps
2017-06-20 19:09:14 +02:00
Frederic Branczyk c4c0875ba3
fix config JSON marshaling 2017-06-08 13:37:57 +02:00
Conor Broderick 5a5acb2d1c Elide secrets in alertmanager config (#841) 2017-06-06 12:02:49 +01:00