* Add date and tz functions to templates
This commit adds the date and tz functions to templates. This means
users can now format time in a specified format and also change
the timezone to their specific locale.
An example of how these functions work, and can be composed together,
can be seen here:
{{ .StartsAt | tz "Europe/Paris" | date "15:04:05 MST" }}
Signed-off-by: George Robinson <george.robinson@grafana.com>
---------
Signed-off-by: George Robinson <george.robinson@grafana.com>
* Update the docs on how to use UTF-8 in label matchers and parse mode feature flags
Signed-off-by: George Robinson <george.robinson@grafana.com>
---------
Signed-off-by: George Robinson <george.robinson@grafana.com>
* feat: implement webhook_url_file for discord
implements #3482
Signed-off-by: Philipp Born <git@pborn.eu>
* feat: implement webhook_url_file for msteams
implements #3536
Signed-off-by: Philipp Born <git@pborn.eu>
---------
Signed-off-by: Philipp Born <git@pborn.eu>
Although it is true that Repeat interval should be greater than or
equal to the Group interval, it should also be a multiple of it too.
If the Repeat interval is not a multiple, then because of how aggregation
groups are flushed, it will be made into one implicitly. This commit
documents this behavior.
Signed-off-by: George Robinson <george.robinson@grafana.com>
This commit updates the docs on inheritance for group_wait,
group_interval and repeat_interval.
Signed-off-by: George Robinson <george.robinson@grafana.com>
This commit updates the docs for slack_config with usage for both
Incoming webhooks and Bot tokens.
Signed-off-by: George Robinson <george.robinson@grafana.com>
* Log a warning when repeat_interval is less than group_interval
This commit updates Alertmanager to log a warning when
repeat_interval is less than group_interval for an individual route.
When repeat_interval is less than group_interval, the earliest
a notification can be sent again is the next time the aggregation
group is flushed, and this happens at each group_interval.
Signed-off-by: George Robinson <george.robinson@grafana.com>
---------
Signed-off-by: George Robinson <george.robinson@grafana.com>
Co-authored-by: gotjosh <josue.abreu@gmail.com>
* Add msteams
Signed-off-by: Jack Zhang <jack4zhang@gmail.com>
---------
Signed-off-by: Jack Zhang <jack4zhang@gmail.com>
Signed-off-by: Jack <jack4zhang@gmail.com>
The version of `github.com/prometheus/common` imported by Alertmanager
adds several fields to the `http_config` and `oauth2` structs for
setting proxy parameters:
* `no_proxy`
* `proxy_from_environment`
* `proxy_connect_header`
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Added note on data retention to documentation for repeat_interval
Signed-off-by: Soon-Ping Phang <soonping@amazon.com>
---------
Signed-off-by: Soon-Ping Phang <soonping@amazon.com>
* 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>
* 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>
* The current page outline was an unstructured and unsorted mess, so I tried to
organize the different configuration file fields into categories.
* I also sorted receivers alphabetically.
* Corrected the Telegram receiver's "bot_token" to be a "secret", not "string".
* Other minor improvements and wording additions to the sections.
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Add explicit UTC to time interval tests
Signed-off-by: Ben Ridley <benridley29@gmail.com>
* Add timezone support to time intervals
Signed-off-by: Ben Ridley <benridley29@gmail.com>
* Update time interval documentation with time zone info
Signed-off-by: Ben Ridley <benridley29@gmail.com>
* Refactor notification tests to test timezone support
Signed-off-by: Ben Ridley <benridley29@gmail.com>
* Make use of Local more clear
Signed-off-by: Ben Ridley <benridley29@gmail.com>
* Fix documentation about timezone support.
Makes it clear that the default is UTC, but others are supported.
Signed-off-by: Ben Ridley <benridley29@gmail.com>
* Remove commented/unused function
Signed-off-by: Ben Ridley <benridley29@gmail.com>
* Fix tests using incorrect timezones
Previously tests were using time zone names that were unsupported by the
RFC822 parser. This switches the tests to use RFC822Z and specifies the
zones by number.
Signed-off-by: Ben Ridley <benridley29@gmail.com>
* Add a few more timezone test cases
Signed-off-by: Ben Ridley <benridley29@gmail.com>
* Remove unnecessary if/else branch
Co-authored-by: Sylvain Rabot <sylvain@abstraction.fr>
Signed-off-by: Ben Ridley <benridley29@gmail.com>
* Rename timezone to location for consistency with Go stdlib
Signed-off-by: Ben Ridley <benridley29@gmail.com>
* Make Windows timezone error more specific
Signed-off-by: Ben Ridley <benridley29@gmail.com>
* Update docs to use 'location'
Signed-off-by: Ben Ridley <benridley29@gmail.com>
* Apply suggestions from code review
Co-authored-by: Sylvain Rabot <sylvain@abstraction.fr>
Signed-off-by: Ben Ridley <benridley29@gmail.com>
Signed-off-by: Ben Ridley <benridley29@gmail.com>
Co-authored-by: Sylvain Rabot <sylvain@abstraction.fr>
* 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>
Some frameworks issue HEAD requests to determine health.
This is meant to be the alertmanager equivalent of prometheus/prometheus#11160
Signed-off-by: Nicolas Dumazet <nicdumz.commits@gmail.com>
Signed-off-by: Nicolas Dumazet <nicdumz.commits@gmail.com>