Commit Graph

41 Commits

Author SHA1 Message Date
Arve Knudsen 6408b55a7c Slack: Use chat.postMessage API by default (#32511)
* Slack: Use only chat.postMessage API

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Slack: Check for response error

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Slack: Support custom webhook URL

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Simplify

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Rewrite tests to use stdlib

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/services/alerting/notifiers/slack.go

Co-authored-by: Dimitris Sotirakis <sotirakis.dim@gmail.com>

* Clarify URL field name

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix linting issue

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix up new Slack notifier

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Improve tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix lint

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Slack: Make token not required

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Alerting: Send validation errors back to client

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Document how token is required

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Make recipient required when using Slack API

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix field description

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: Dimitris Sotirakis <sotirakis.dim@gmail.com>
2021-04-22 16:00:21 +02:00
Peter Holmberg 400aafa3b3 Migration: Edit notification channel (#25980)
* implement edit page

* connectWithCleanup

* remove angular related code

* use loadingindicator

* use the correct loading component

* handle secureFields

* fixed implementation of secure fields

* Keep secureFields after rerendering the form

* CollapsableSection and Page refactor

* use checkbox instead of switch

* fix comment

* add cursor to section

* Fixed issues after PR review

* Fix issue with some settings being undefined

* new reducer and start with test

* algorithm to migrate secure fields

* UX: Minor UI Tweaks

* Added field around checkboxes, and missing required field

* fixed test

* tests for util

* minor tweaks and changes

* define as records

* fix typ error

* forward invalid to textarea and inputcontrol

* merge formdata and redux data in test

* fix issue with creating channel

* do not figure out securefields in migration

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-09-09 12:46:19 +02:00
Peter Holmberg 6465b2f0a3 Migration: Migrate New notification channel page (#25265)
* creating page

* add types select

* adding switches

* start with converting angular templates to json

* converting more alert channels to new format

* convert remaining channels

* typing the form

* add validation, update models

* fix default value in type select

* fix type

* fix issue with validation rule

* add missing settings

* fix type errors

* test notification

* add comments to structs

* fix selectable value and minor things on each channel

* More typings

* fix strictnull

* rename ModelValue -> PropertyName

* rename show -> showWhen

* add enums and adding comments

* fix comment

* break out channel options to component

* use try catch

* adding default case to OptionElement if element not supported
2020-06-29 13:39:12 +02:00
Arve Knudsen 07582a8e85 Chore: Fix various spelling errors in back-end code (#25241)
* Chore: Fix various spelling errors in back-end code
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>>
2020-06-01 17:11:25 +02:00
Marcus Efraimsson 6bd7411f04 Alerting: Only include image in notifier when enabled (#23194)
Fixes a bug when you had multiple notifiers for a rule, but not all 
had enabled to include image.

Fixes #22883
2020-03-31 00:46:01 +02:00
Marcus Efraimsson 0f0772b629 Alerting: Adds support for sending a single email to all recipients in notification channel (#21091)
When an alert is sent by e-mail, the process sends an e-mail to 
each recipient separately. This PR is a single delivery to all recipients.
For companies that use e-mail extensively, this is necessary in order 
not to overload the sending queue.

Replaces #18013
Fixes #12650

Co-authored-by: Henrique Oliveira <holiiveira@users.noreply.github.com>
2020-01-10 16:06:33 +01:00
Oleg Gaidarenko 35b74a99a8 Emails: resurrect template notification (#18686)
* Emails: resurrect template notification

* Phantomjs (oh yeah, there is another dev dep phantom :-) was failing for
  the generation of the html templates so I had to update the dependencies
  in order to fix it. While doing that I update the scripts field and docs
  for it as well. yarn.lock is included

* Move splitting of the emails to separate helper function, since more services
  coming up that would need to use this functionality

* Add support for enterprise specific email letters. Probably could
  be done in the better way, but it's not a priority right now
2019-08-26 17:19:03 +02:00
Carl Bergquist d8736a2547 Alerting: golint fixes for alerting (#17246) 2019-06-03 10:25:58 +02:00
Carl Bergquist bfa7c3d963 alerting: golint fixes for alert notifiers. (#17167) 2019-05-20 15:23:06 +02:00
Carl Bergquist 13f137a17d tech: avoid alias for importing models in alerting (#17041)
ref #14679
2019-05-14 08:15:05 +02:00
zhulongcheng 2fff8f77dc move log package to /infra (#17023)
ref #14679

Signed-off-by: zhulongcheng <zhulongcheng.me@gmail.com>
2019-05-13 08:45:54 +02:00
Navaneesh Kumar 5ea823a65a Fix: Alert email variable name typo fixed (#16232) 2019-03-27 09:42:20 +01:00
bergquist 7333d7b8d4 alerting: invert sendOnce to sendReminder 2018-06-05 10:44:17 +02:00
John Baublitz 3cb0e27e1c Revert changes post code review and move them to notification page 2018-06-04 13:19:14 +02:00
Corentin Chary d4d2b6d7da notitfiers: avoid ShouldNotify duplication 2018-03-15 10:48:29 +01:00
Matt 0dffb6dbb1 Adjusted the border color on the buttons in dashboard nav, fixed alert email text area width, fixed padding-top issue on dashboard settings aside 2018-01-18 14:40:08 +01:00
Thibault Chataigner fd633a1d5d Add a per-notifier ShouldNotify()
This way we are able to edit notification behavior per notifier.
This would be usefull to let some notifiers send notifications,
even when the state doesn't change, or with custom condition.

Signed-off-by: Thibault Chataigner <t.chataigner@criteo.com>
2017-12-12 17:35:54 +01:00
bergquist 2de94d6548 convert old metrics to prom metrics 2017-09-14 14:26:32 +02:00
Dan Cech 9dc220b8e2 include error message in email notification (#8392) 2017-05-17 09:51:51 +02:00
Wouter Smit 125ee865b6 Spelling mistake (#7739) 2017-03-06 21:08:45 +01:00
Torkel Ödegaard b8f559aecb feat(plugins): made notifiers more pluggable and easier to support many of them, new ones can now be added without modifying any existing file, #7162 2017-01-06 12:04:25 +01:00
bergquist c467e48940 feat(notifications): removes html escaping subject
closes #6905
2016-12-15 14:27:33 +01:00
huydx 015fa82cf5 fix(alert): alert test should return error when it failed to dispatch 2016-12-12 18:22:58 +09:00
Torkel Ödegaard 4999fff29b fix(alerting): fixed email notification so it splits email address multiple ways, fixes #6353 2016-10-22 10:24:31 +02:00
bergquist f77799837e feat(alerting): support for attached graphs in alert notifications
closes #6183
2016-10-21 09:06:03 +02:00
bergquist ded5a0a9d5 tech(alerting): remove unused code 2016-10-21 09:05:54 +02:00
bergquist 6ea0f0120e feat(notifications): switch to ; seperator
using \n caused problems with the json deserialisation.

closes #6326
2016-10-19 16:34:12 +02:00
bergquist 3162e680c2 tech(notifiers): improve logging for notifications
ref #6228
2016-10-11 10:15:41 +02:00
bergquist d726f49a8c fix(notification): broken test notifications
ref #6159
2016-10-03 17:03:21 +02:00
Carl Bergquist c38f6ff182 Make alerting notifcations sync (#6158)
* tech(routines): move the async logic from notification to alerting notifier

* tech(notification): reduce code dupe

* fix(notification): dont touch the response unless its an error

* feat(alerting): make alerting exeuction async but flow sync

* tech(alerting): remove commented code

* tech(alerting): remove unused code

* tech(alerting): fix typo

* tech(alerting): implement Context on EvalContext

* tech(alerting): wait for all alerts to return

* feat(alerting): dont allow alert responses to cancel

* Revert "feat(alerting): dont allow alert responses to cancel"

This reverts commit 324b006c96.

* feat(alerting): give alerts some time to finish before closing down
2016-10-03 09:38:03 +02:00
Torkel Ödegaard b0c7e61ef8 feat(alerting): removed severity 2016-09-13 15:09:55 +02:00
bergquist 55b560a4a8 feat(alerting): filter notifications based on severity
closes #5851
2016-09-06 14:27:48 +02:00
bergquist 7ddd625e9d feat(alerting): add slack/email support for execution errors 2016-08-31 15:55:01 +02:00
Torkel Ödegaard 0392fde34e feat(alerting): doing schema changes 2016-08-15 15:12:43 +02:00
bergquist fb7a6c0764 feat(alerting): list all series in alert email 2016-08-13 12:50:51 +02:00
bergquist c4e905474a feat(alerting): improve email notifications layout 2016-08-13 11:24:03 +02:00
bergquist 937726499f feat(alerting): add global usage metrics for alerting
closes #5786
2016-08-11 21:12:46 +02:00
Torkel Ödegaard 357358898d feat(annotations): working on alert annotations, #5694 2016-08-01 10:07:00 +02:00
Torkel Ödegaard 2b276d5cd1 feat(alerting): working on alert notification and image rendering 2016-07-30 13:36:21 +02:00
Torkel Ödegaard 717cce014b feat(alerting): refactoring 2016-07-27 17:07:44 +02:00
Torkel Ödegaard ae5f8a76d9 feat(alerting): lots of progress on notifications, refactored them out to their own package, restored webhook notitication and added slack notification 2016-07-27 12:09:55 +02:00