Commit Graph

2797 Commits

Author SHA1 Message Date
Simon Pasquier
4353c4e6e9
Merge pull request #3123 from prometheus/dependabot/go_modules/github.com/gofrs/uuid-4.3.1incompatible
Bump github.com/gofrs/uuid from 4.3.0+incompatible to 4.3.1+incompatible
2022-11-15 10:52:05 +01:00
dependabot[bot]
3b2cd4866c
Bump go.uber.org/atomic from 1.9.0 to 1.10.0
Bumps [go.uber.org/atomic](https://github.com/uber-go/atomic) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/uber-go/atomic/releases)
- [Changelog](https://github.com/uber-go/atomic/blob/master/CHANGELOG.md)
- [Commits](https://github.com/uber-go/atomic/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: go.uber.org/atomic
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-15 09:50:57 +00:00
Simon Pasquier
989a9122f6
Merge pull request #3122 from prometheus/dependabot/go_modules/github.com/matttproud/golang_protobuf_extensions-1.0.4
Bump github.com/matttproud/golang_protobuf_extensions from 1.0.2 to 1.0.4
2022-11-15 10:50:33 +01:00
Simon Pasquier
11e37e8d51
Merge pull request #3125 from prometheus/dependabot/go_modules/golang.org/x/tools-0.2.0
Bump golang.org/x/tools from 0.1.12 to 0.2.0
2022-11-15 10:49:58 +01:00
gotjosh
2c9eb9858e
Change duplicated tags
Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-11-14 11:24:34 +00:00
gotjosh
f51f51ec72
Use the new truncation in bytes functions to ensure strings are not butchered
Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-11-11 15:15:09 +00:00
gotjosh
7f94b16470
Validate that either bot_token or http_configs.authorization must be present
Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-11-09 20:07:54 +00:00
gotjosh
e8b5c0aa0d
Fix and add a new test
Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-11-09 20:07:54 +00: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
gotjosh
9e2608ebff
Notifier: Webex
Cisco's Webex has been one of the most requested notifiers on Grafana for a while now, please see: https://github.com/grafana/grafana/issues/11750#issue-318358659

Given it's straightforward implementation, low maintance overhead and request demand, I think it's worth including this directly in the Alertmanager.

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-11-09 20:07:54 +00:00
gotjosh
ba8da18fb2
Merge pull request #3135 from prometheus/fix-truncate
Truncate: Be explicit on truncation of runes or bytes.
2022-11-09 20:03:43 +00:00
gotjosh
964edb741d
Address review comments
Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-11-09 18:05:48 +00:00
gotjosh
4ecf5044dd
fix typo
Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-11-09 17:31:17 +00:00
gotjosh
c7362ab831
Fix comments
Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-11-09 17:20:22 +00:00
gotjosh
b3f50f0c84
Truncate: Be explicit on truncation of runes or bytes.
While most integrations set a limit by UTF-8 compatible characters (some like Webex) use runes - as pointed out in https://github.com/prometheus/alertmanager/pull/3132. This PR makes it explicit wether the truncation is happening at a byte or rune level.

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-11-09 17:17:42 +00:00
dependabot[bot]
d5501dbf87
Bump golang.org/x/tools from 0.1.12 to 0.2.0
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.1.12 to 0.2.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.1.12...v0.2.0)

---
updated-dependencies:
- dependency-name: golang.org/x/tools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-01 15:10:10 +00:00
dependabot[bot]
eb3d39ec95
Bump github.com/gofrs/uuid from 4.3.0+incompatible to 4.3.1+incompatible
Bumps [github.com/gofrs/uuid](https://github.com/gofrs/uuid) from 4.3.0+incompatible to 4.3.1+incompatible.
- [Release notes](https://github.com/gofrs/uuid/releases)
- [Commits](https://github.com/gofrs/uuid/compare/v4.3.0...v4.3.1)

---
updated-dependencies:
- dependency-name: github.com/gofrs/uuid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-01 15:09:55 +00:00
dependabot[bot]
dafa434173
Bump github.com/matttproud/golang_protobuf_extensions
Bumps [github.com/matttproud/golang_protobuf_extensions](https://github.com/matttproud/golang_protobuf_extensions) from 1.0.2 to 1.0.4.
- [Release notes](https://github.com/matttproud/golang_protobuf_extensions/releases)
- [Changelog](https://github.com/matttproud/golang_protobuf_extensions/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matttproud/golang_protobuf_extensions/compare/v1.0.2...v1.0.4)

---
updated-dependencies:
- dependency-name: github.com/matttproud/golang_protobuf_extensions
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-01 15:09:50 +00:00
Marco Pracucci
33bba95099
Reduce memory utilization in downstream projects creating multiple Alertmanager instances (#3114)
* Reduce memory utilization in downstream projects creating multiple Alertmanager instances

Signed-off-by: Marco Pracucci <marco@pracucci.com>
2022-10-26 10:49:20 +02:00
Matthias Loibl
28c3df0173
Merge pull request #2948 from metalmatze/discord
notify/discord: Create Discord integration
2022-10-25 18:24:19 +02: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
Martin Schimandl
893ad67978
Allow first day of week to be Sunday or Monday (#3093)
* Allow week to start at Monday or Sunday

Signed-off-by: Martin Schimandl <martin.schimandl@gmail.com>

* refactor from Int to DataType

Signed-off-by: Martin Schimandl <martin.schimandl@gmail.com>

* refactor to use name 'firstDayOfWeek' everywhere

Signed-off-by: Martin Schimandl <martin.schimandl@gmail.com>

* CSS fine tuning

Signed-off-by: Martin Schimandl <martin.schimandl@gmail.com>

* Check firstDayOfWeek with case statements

Signed-off-by: Martin Schimandl <martin.schimandl@gmail.com>

* Change default to Sunday. Use radio buttons

Signed-off-by: Martin Schimandl <martin.schimandl@gmail.com>

* Update ui/app/src/Views/Settings/Views.elm

Co-authored-by: Andrey Kuzmin <unsoundscapes@gmail.com>
Signed-off-by: Martin Schimandl <martin.schimandl@gmail.com>

* Regenerate assets_vfsdata.go

Signed-off-by: Martin Schimandl <martin.schimandl@gmail.com>

Signed-off-by: Martin Schimandl <martin.schimandl@gmail.com>
Co-authored-by: Andrey Kuzmin <unsoundscapes@gmail.com>
2022-10-19 18:01:24 +02:00
Oktarian T-B
d4d36e400a
Log Response Details for Notifier errors for Webhooks, Pushover and VictorOps (#3103)
* Pass in response body to Retrier Check
* Custom error details for webhook notifier

Signed-off-by: Oktarian Tilney-Bassett <oktariantilneybassett@improbable.io>
2022-10-19 15:07:38 +02:00
Julien Pivotto
21ca295319
Merge pull request #2982 from roidelapluie/expiresoon
Expires notify log sooner when possible
2022-10-19 09:26:37 +02:00
Xavier Nicollet
7dd34c6b4c Fixup: make signal handlers a bit simpler.
No need to spawn a goroutine, nor wait for a channel.
Let's just put everything in a single select call.

Signed-off-by: Xavier Nicollet <xnicollet@gmail.com>
2022-10-17 21:40:50 +01: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
Julien Pivotto
b0443021dc Expires notify log sooner when possible
It seems useless to keep the notifications in the nflog for longer than
twice the repeat interval. This should help reduce memory usage of
clustered alertmanagers.

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-10-14 10:03:17 +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
Marco Pracucci
78b5a27d40
Reduce memory utilization in downstream projects creating multiple Alertmanager instances (#3092)
* Reduce memory utilization in downstream projects creating multiple Alertmanager instances

* Wrap the error instead of citing it

Signed-off-by: Marco Pracucci <marco@pracucci.com>
2022-10-06 09:01:51 +02:00
Christopher Taylor
2c04c5aaa7
UI: add 'Link' button to alerts in list (#2880)
* add 'Link' button

adds a button to each alert that allows linking to a single alert.
This works by generating a link that filters on _all_ of the alert's
label values, similar to the button to create a new silence from an
alert.

Signed-off-by: Christopher Taylor <chris.taylor@soundcloud.com>

* update asset/assets_vfsdata.go

Signed-off-by: Christopher Taylor <chris.taylor@soundcloud.com>

Signed-off-by: Christopher Taylor <chris.taylor@soundcloud.com>
2022-10-05 18:29:12 +02:00
Simon Pasquier
ae510d09c0
Merge pull request #3088 from prometheus/dependabot/go_modules/github.com/gofrs/uuid-4.3.0incompatible
Bump github.com/gofrs/uuid from 4.2.0+incompatible to 4.3.0+incompatible
2022-10-03 12:12:19 +02:00
Simon Pasquier
5948b575d8
Merge pull request #3089 from prometheus/dependabot/go_modules/github.com/matttproud/golang_protobuf_extensions-1.0.2
Bump github.com/matttproud/golang_protobuf_extensions from 1.0.1 to 1.0.2
2022-10-03 11:43:58 +02:00
Simon Pasquier
2c0b8849e0
Merge pull request #3090 from prometheus/dependabot/go_modules/github.com/aws/aws-sdk-go-1.44.109
Bump github.com/aws/aws-sdk-go from 1.44.94 to 1.44.109
2022-10-03 11:43:32 +02:00
dependabot[bot]
0a364c3382
Bump github.com/aws/aws-sdk-go from 1.44.94 to 1.44.109
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.94 to 1.44.109.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.94...v1.44.109)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-01 15:05:33 +00:00
dependabot[bot]
cf18f8f132
Bump github.com/matttproud/golang_protobuf_extensions
Bumps [github.com/matttproud/golang_protobuf_extensions](https://github.com/matttproud/golang_protobuf_extensions) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/matttproud/golang_protobuf_extensions/releases)
- [Commits](https://github.com/matttproud/golang_protobuf_extensions/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: github.com/matttproud/golang_protobuf_extensions
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-01 15:05:24 +00:00
dependabot[bot]
2df6a25acd
Bump github.com/gofrs/uuid from 4.2.0+incompatible to 4.3.0+incompatible
Bumps [github.com/gofrs/uuid](https://github.com/gofrs/uuid) from 4.2.0+incompatible to 4.3.0+incompatible.
- [Release notes](https://github.com/gofrs/uuid/releases)
- [Commits](https://github.com/gofrs/uuid/compare/v4.2.0...v4.3.0)

---
updated-dependencies:
- dependency-name: github.com/gofrs/uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-01 15:05:19 +00:00
gotjosh
5455296392
Merge pull request #2968 from prometheus/parse-matchers-empty-value
Ensure matcher values are present when parsing matchers from strings
2022-09-30 12:51:55 +01:00
gotjosh
bd89550ce2
Take another approach
Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-09-30 12:36:32 +01:00
gotjosh
05f073f42f
Ensure matcher values are present when parsing matchers from strings
Fixes #2936

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-09-30 12:36:32 +01:00
gotjosh
0a9a48d60f
Appease the linter on timeinterval.go (#3085)
Signed-off-by: gotjosh <josue.abreu@gmail.com>

Signed-off-by: gotjosh <josue.abreu@gmail.com>
2022-09-30 13:33:28 +02:00
Simon Pasquier
fe0622ab14
notify/email: refactor tests (#3078)
We don't need to test `getPassword()` separately as it can be covered
with the tests already checking the various authentication methods.

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

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-09-30 13:32:25 +02:00
gotjosh
632ddb8463
Merge pull request #3077 from simonpasquier/update-maintainers
MAINTAINERS.md: add @gotjosh
2022-09-26 14:23:45 +01:00
Ben Ridley
33a0e77a71
Add timezone support to time intervals. (#2782)
* 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>
2022-09-22 14:45:17 +02:00
Joe Blubaugh
dc0913b252
EmailConfig: Use CanonicalMIMEHeaderKey instead of TitleCasing for headers (#3080)
* EmailConfig: Use CanonicalMIMEHeaderKey instead of TitleCasing for headers

Fixes #3064.

Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>

* Remove an unused field.

Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>

Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>
2022-09-22 14:41:25 +02:00
Simon Pasquier
2657e384f7 MAINTAINERS.md: add @gotjosh
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-09-16 16:09:47 +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
Yanks Yoon
3d624c0552
replace 3 dots with ellipsis (#3072)
Signed-off-by: charlie4284 <charlie4284@gmail.com>

Signed-off-by: charlie4284 <charlie4284@gmail.com>
2022-09-12 17:28:10 +02:00
dependabot[bot]
59476d4a1c
Bump github.com/go-openapi/swag from 0.21.1 to 0.22.3 (#3066)
Bumps [github.com/go-openapi/swag](https://github.com/go-openapi/swag) from 0.21.1 to 0.22.3.
- [Release notes](https://github.com/go-openapi/swag/releases)
- [Commits](https://github.com/go-openapi/swag/compare/v0.21.1...v0.22.3)

---
updated-dependencies:
- dependency-name: github.com/go-openapi/swag
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-12 12:25:23 +02:00
sunb3am
346f890b70
Docs: Updated README.md to include links to receiver integrations (#2996)
* Docs: Minor update to README.md to include links to receiver integrations

Updated receiver integrations with links to their landing pages for easier reference and accessibility.

Signed-off-by: sunb3am <57086182+sunb3am@users.noreply.github.com>

* Added link to integrations in documentation

Added a link to the integrations in our documentation for ease of access.

Signed-off-by: sunb3am <57086182+sunb3am@users.noreply.github.com>

* Added receiver integrations link

Signed-off-by: sunb3am <57086182+sunb3am@users.noreply.github.com>

* README.md: preserve Oxford comma :)

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

* Update README.md with clearer language

Rephrased receiver integrations text in README

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: sunb3am <57086182+sunb3am@users.noreply.github.com>

Signed-off-by: sunb3am <57086182+sunb3am@users.noreply.github.com>
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2022-09-12 12:24:57 +02:00
Simon Pasquier
8f95ee907b
Set min version of go.mod to 1.18 (#3070)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-09-12 11:26:01 +02:00