Commit Graph

77 Commits

Author SHA1 Message Date
Mike 71d61c9c91
fix comment (#2869)
Signed-off-by: mikechengwei <842725815@qq.com>
2022-04-08 14:51:02 +02:00
Sinuhe Tellez Rivera d155153305
Adds: Active time interval (#2779)
* add active time interval

Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* fix active time interval

Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* fix unittests for active time interval

Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update notify/notify.go

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update dispatch/route.go

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* split the stage for active and mute intervals

Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update notify/notify.go

Adds doc for a helper function

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update notify/notify.go

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update notify/notify.go

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update notify/notify.go

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* fix code after commit suggestions

Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Making mute_time_interval and time_intervals can coexist in the config

Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* docs: configuration's doc has been updated about time intervals

Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update config/config.go

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update docs/configuration.md

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update docs/configuration.md

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update docs/configuration.md

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update docs/configuration.md

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* updates configuration readme to improve active time description

Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* merge deprecated mute_time_intervals and time_intervals

Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update docs/configuration.md

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update docs/configuration.md

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update docs/configuration.md

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update docs/configuration.md

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update docs/configuration.md

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update docs/configuration.md

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update cmd/alertmanager/main.go

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update cmd/alertmanager/main.go

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* fmt main.go

Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update docs/configuration.md

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update docs/configuration.md

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* fix lint error

Signed-off-by: clyang82 <chuyang@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Document that matchers are ANDed together

Signed-off-by: Mac Chaffee <me@macchaffee.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Remove extra parentheticals

Signed-off-by: Mac Chaffee <me@macchaffee.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* config: root route should have empty matchers

Unmarshal should validate that the root route does
not contain any matchers. Prior to this change,
only the deprecated match structures were checked.

Signed-off-by: Philip Gough <philip.p.gough@gmail.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* chore: Let git ignore temporary files for ui/app

Signed-off-by: nekketsuuu <nekketsuuu@users.noreply.github.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* adding max_alerts parameter to slack webhook config

correcting the logic to trucate fields instead of dropping alerts in the slack integration

Signed-off-by: Prashant Balachandran <pnair@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* *: 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>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Automate CSS-inlining for default HTML email template (#2798)

* Automate CSS-inlining for default HTML email template

The original HTML email template was added in `template/email.html`.
It looks like the CSS was manually inlined.  Most likely using the
premailer.dialect.ca web form, which is mentioned in the README for
the Mailgun transactional-email-templates project.  The resulting HTML
with inlined CSS was then copied into `template/default.tmpl`.  This
has resulted in `email.html` and `default.tmpl` diverging at times.

This commit adds build automation to inline the CSS automatically
using [juice][1].  The Go template containing the resulting HTML has
been moved into its own file to avoid the script that performs the CSS
inlining having to parse the `default.tmpl` file to insert it there.

Fixes #1939.

[1]: https://www.npmjs.com/package/juice

Signed-off-by: Brad Ison <bison@xvdf.io>

* Update asset/assets_vfsdata.go

Signed-off-by: Brad Ison <bison@xvdf.io>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* go.{mod,sum}: update Go dependencies

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* amtool to support http_config to access alertmanager (#2764)

* Support http_config for amtool

Co-authored-by: Julien Pivotto <roidelapluie@gmail.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: clyang82 <chuyang@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* notify/sns: detect FIFO topic based on the rendered value

Since the TopicARN field is a template string, it's safer to check for
the ".fifo" suffix in the rendered string.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* 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>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* fix unittests

Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* fix comment about active time interval

Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* fix another comment about active time interval

Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update docs/configuration.md

Fix typo in documentation

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

* Update docs/configuration.md

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Sinuhe Tellez <dubyte@gmail.com>

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: clyang82 <chuyang@redhat.com>
Co-authored-by: Mac Chaffee <me@macchaffee.com>
Co-authored-by: Philip Gough <philip.p.gough@gmail.com>
Co-authored-by: nekketsuuu <nekketsuuu@users.noreply.github.com>
Co-authored-by: Prashant Balachandran <pnair@redhat.com>
Co-authored-by: Simon Pasquier <pasquier.simon@gmail.com>
Co-authored-by: Brad Ison <brad.ison@redhat.com>
Co-authored-by: Julien Pivotto <roidelapluie@gmail.com>
2022-03-04 15:24:29 +01:00
Tim 1138a088f6
Adding telegram support (#2827)
* added telegram config in notifiers

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* added telegram config to config.go

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* added package telegram to notify and initialization in cmd

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* added telegram.default.message

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* added telegram template to notifiers.go

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* added message rendering from template to telegram integration

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* documentation for telegram_configs

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* added tests for telegram

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* fixed config_test.go

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* added valid parse_mode list to the error log

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* made use of httpconfig, moved telegram client creation to New func, changed message truncation to 4096 chars

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* changed supported values for telegram config

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* added mock url for telegram tests to pass

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* added api_url check to telegram config

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* changed bot_token type to secret

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* removed extra emptyline

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* convert bot_token to string in telegram client creation

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* updated configuration.md

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* fixed mixed up errors

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>

* check telegram api url without conversion to string

Signed-off-by: timmilesdw <tuktamyshev.t0308@gmail.com>
2022-02-22 17:51:02 +01:00
Julius Volz 77bdc89343 Fix markdown list describing Alertmanager matchers
The Markdown variant used on prometheus.io is different from the GitHub one and
requires code blocks to be indented by four spaces to be recognized as part of
a list item vs. terminating the list.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2022-02-01 16:50:41 +01:00
Simon Pasquier ec83f71257
Merge pull request #2758 from mac-chaffee/main
Document that matchers are ANDed together
2021-12-17 16:32:24 +01:00
Philip Gough 30e0da4754
opsgenie: Extend config with 'entity' and 'actions' fields (#2753)
Signed-off-by: Philip Gough <philip.p.gough@gmail.com>
2021-11-13 07:37:59 +01:00
mousavian 2f445bcf98
Add support for security-related HTTP headers (#2759)
* Add support for security-related HTTP headers

Signed-off-by: Rahman Mousavian <mousavian.rahman@gmail.com>

* go mod tidy

Signed-off-by: Rahman Mousavian <mousavian.rahman@gmail.com>
2021-11-10 17:29:04 +01:00
Mac Chaffee 5e88a91be5
Remove extra parentheticals
Signed-off-by: Mac Chaffee <me@macchaffee.com>
2021-11-09 17:57:57 -05:00
Mac Chaffee 78545d8abc
Document that matchers are ANDed together
Signed-off-by: Mac Chaffee <me@macchaffee.com>
2021-11-06 22:35:45 -04:00
csuzhang b7035556e8
Update outdated url link with slack (#2749)
* fix outdated url link with slack

Signed-off-by: csuzhang <csuzhang@tencent.com>
2021-11-04 22:47:07 +01:00
markoposavec 05490d8954
Dynamic opsgenie responders (#2685)
* added option to specify multiple teams in opsgenie configuration

Signed-off-by: Marko Posavec <maposavec@infobip.com>
2021-11-04 22:32:20 +01:00
Philip Gough f52c11f3d1 docs: Update default value for opsgenie_config 'message'.
Signed-off-by: Philip Gough <philip.p.gough@gmail.com>
2021-10-28 16:59:49 +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
Takuma Ishikawa 789a7bd6c3
Minor fixes on docs of receiver (#2726)
Signed-off-by: Takuma Ishikawa <nekketsuuu@users.noreply.github.com>
2021-10-19 01:07:53 +02:00
Julien Pivotto 70abcccedb
Merge pull request #2725 from prometheus/release-0.23
docs: Fix default value of send_resolved for sns_configs (#2724)
2021-10-01 11:56:08 +02:00
Takuma Ishikawa 16fa045db4
docs: Fix default value of send_resolved for sns_configs (#2724)
Signed-off-by: Takuma Ishikawa <nekketsuuu@users.noreply.github.com>
2021-10-01 11:27:26 +02:00
Julien Pivotto 44011410d7
Merge pull request #2519 from tomasfreund/opsgenie-update-message-description
Add the option to update message and description when sending alerts to opsgenie
2021-09-08 17:10:59 +02:00
machinly 829e884a8d Fix some typo
Signed-off-by: machinly <machinly@acm.org>
2021-08-16 16:34:53 +08:00
machinly fbf9bee8af Fix some typo
Signed-off-by: machinly <machinly@acm.org>
2021-08-16 16:34:53 +08:00
machinly c9abed28d2 Make the apostrophe uniform
Signed-off-by: machinly <machinly@acm.org>
2021-08-16 16:34:53 +08:00
Tomáš Freund ecf87d15a0 add update_alerts option docs
Signed-off-by: Tomáš Freund <tomas.freund@datamole.cz>
2021-08-10 19:05:54 +02:00
tomasfreund cafd84bedb Update docs/configuration.md
Co-authored-by: Victor Coutellier <victor.coutellier@gmail.com>
Signed-off-by: Tomáš Freund <tomas.freund@datamole.cz>
2021-08-10 19:05:54 +02:00
tomasfreund e9f1f19611 Apply suggestions from code review
Co-authored-by: Julien Pivotto <roidelapluie@gmail.com>
Signed-off-by: Tomáš Freund <tomas.freund@datamole.cz>
2021-08-10 19:05:54 +02:00
Tomáš Freund 79dfb86c7b add the option to update message and description when sending alerts to opsgenie
Signed-off-by: Tomáš Freund <tomas.freund@datamole.cz>
2021-08-10 19:05:54 +02:00
Dustin Hooten ff85bec45b
Secure cluster traffic via mutual TLS (#2237)
* Add TLS option to gossip cluster

Co-authored-by: Sharad Gaur <sharadgaur@gmail.com>
Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* generate new certs that expire in 100 years

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* Fix tls_connection attributes

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* Improve error message

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* Fix tls client config docs

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* Add capacity arg to message buffer

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* fix formatting

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* Update version; add version validation

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* use lru cache for connection pool

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* lock reading from the connection

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* when extracting net.Conn from tlsConn, lock and throw away wrapper

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* Add mutex to connection pool to protect cache

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* fix linting

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

Co-authored-by: Sharad Gaur <sharadgaur@gmail.com>
2021-08-09 14:58:06 -06:00
Laurent CREPET 0c3a00ecc0
OpsGenie: refer to alert instead of incident (#2609)
* OpsGenie provides management of both alerts and incidents.
* package opsgenie uses OpsGenie alert api, so let's refer to
  alert instead of incident in logs and doc to avoid confusion.

Signed-off-by: Laurent CREPET <l.crepet@criteo.com>
2021-08-04 13:53:44 +02:00
Julien Pivotto b2a4cacb95 Update go dependencies & switch to go-kit/log
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2021-08-02 12:43:23 +02:00
Julien Pivotto 010c683e4e
Merge pull request #2615 from treid314/sns-reciever
Add AWS SNS receiver
2021-07-26 10:30:08 +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 7ecb6bcb22 Check Error in unit test and clean up docs
Signed-off-by: Tyler Reid <tyler.reid@grafana.com>
2021-07-06 18:17:40 -05:00
Tyler Reid 208bed6dee Update config docs to clarify fifo SNS deduplication strategy. Remove extra api call get topic attributes and use '.fifo' strategy instead
Signed-off-by: Tyler Reid <tyler.reid@grafana.com>
2021-06-27 20:26:44 -05:00
Julien Pivotto e3fb99cc2d
Rename default branch to main (#2501)
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2021-06-23 10:06:52 +01:00
Tyler Reid 8911051770 Make API URL optional, clear up credential logic
Signed-off-by: Tyler Reid <tyler.reid@grafana.com>
2021-06-21 12:29:03 -05:00
Tyler Reid 4ebcaf9c23 Merge remote-tracking branch 'upstream/master' into sns-reciever 2021-06-17 18:05:11 -05:00
Tyler Reid 63f9082ec4 Fix docs spacing
Signed-off-by: Tyler Reid <tyler.reid@grafana.com>
2021-06-17 10:45:27 -05:00
Tyler Reid b9b53f172d Code review fixes
Signed-off-by: Tyler Reid <tyler.reid@grafana.com>
2021-06-17 08:55:27 -05:00
Tyler Reid 3446b35272 Code review fixes: copy attributes, truncate all the messages, fix logging, remove api_version
Signed-off-by: Tyler Reid <tyler.reid@grafana.com>
2021-06-16 14:27:19 -05:00
Tyler Reid 8d3b1b5896 Add config docs
Signed-off-by: Tyler Reid <tyler.reid@grafana.com>
2021-06-15 18:03:15 -05:00
Sebastian Neuner 8c956f8d64 fixed typo 'weeekday_range' → 'weekday_range'
Signed-off-by: Sebastian Neuner <neuner@belwue.de>
2021-06-10 15:59:48 +02:00
Julien Pivotto 66cfee4b3b
Merge pull request #2599 from prometheus/release-0.22
Merge back release 0.22
2021-05-26 01:07:21 +02:00
Julien Pivotto 0d1b95b5ca Add a note about Pushover ready-to-clone app
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2021-05-26 00:27:42 +02:00
Julien Pivotto 4205230f70
Merge pull request #2575 from d-zalewski/docs-https-typo
fixed small typo
2021-05-10 23:01:38 +02:00
Dominik Zalewski a33bc8c2d4 fixed small typo
Signed-off-by: Dominik Zalewski <kobazik@gmail.com>
2021-05-10 21:50:15 +01:00
beorn7 0ed31c3311 Update matcher examples
While the documentation for the matchers themselves was updated, we
missed the examples.

I propose to merge this into the release-0.22 branch so that it gets
included in the ongoing release.

Signed-off-by: beorn7 <beorn@grafana.com>
2021-05-06 19:17:59 +02:00
maxbrodin 1f3796c5cc
Lift moratorium on AlertManager receivers with long-term maintenance plan (#2561)
* Lift moratorium on AlertManager notifiers

Signed-off-by: Max Brodin <mbrodin@amazon.com>
2021-05-04 16:59:03 +02:00
Levi Harrison f4b176fa5e
Add OAuth 2.0 Config (#2560)
* Upgraded common to v0.23.0

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Added oauth2 to configuration doc

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Fix go.sum

Signed-off-by: Levi Harrison <git@leviharrison.dev>
2021-04-29 13:31:54 +02:00
Björn Rabenstein 699439b021
Merge pull request #2481 from aSquare14/docs-1
docs for negative matchers for route, inhibition
2021-04-20 00:28:08 +02:00
aSquare14 fc42013dad fixup examples
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
2021-04-18 22:18:51 +05:30
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