* Alerting: Do not include button in googlechat notification if URL invalid
* Apply suggestions from code review
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
* Alerting: Add test case for invalid external URL in googlechat notifier
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
* propagate notificationservice down to the notifiers
* replace dispatch in result handler
* remove dispatch from the rule reader
* remove dispatch from eval context
* remove dispatch from alerting usage
* remove dispatch from alerting usage
* remove dispatch from notifier
* attempt to fix tests in alerting
* hello linter, my old friend; also disable some tests for now
* use mocks to fix the tests
* resolving wire providers
* make linter happy
* remove yet another bus.dispatch
* fix tests using store mock
* Added an option to discord notifier to use discord's webhook name (useful for customizing notifications).
* Support ngalert system with discord username toggle
* Added ngalert discord test
* Apply suggestions from code review
Co-authored-by: gotjosh <josue.abreu@gmail.com>
* Docs updated with discord username setting
* Fix api integration test
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: gotjosh <josue.abreu@gmail.com>
* Encryption: Add support to encrypt/decrypt sjd
* Add datasources.Service as a proxy to datasources db operations
* Encrypt ds.SecureJsonData before calling SQLStore
* Move ds cache code into ds service
* Fix tlsmanager tests
* Fix pluginproxy tests
* Remove some securejsondata.GetEncryptedJsonData usages
* Add pluginsettings.Service as a proxy for plugin settings db operations
* Add AlertNotificationService as a proxy for alert notification db operations
* Remove some securejsondata.GetEncryptedJsonData usages
* Remove more securejsondata.GetEncryptedJsonData usages
* Fix lint errors
* Minor fixes
* Remove encryption global functions usages from ngalert
* Fix lint errors
* Minor fixes
* Minor fixes
* Remove securejsondata.DecryptedValue usage
* Refactor the refactor
* Remove securejsondata.DecryptedValue usage
* Move securejsondata to migrations package
* Move securejsondata to migrations package
* Minor fix
* Fix integration test
* Fix integration tests
* Undo undesired changes
* Fix tests
* Add context.Context into encryption methods
* Fix tests
* Fix tests
* Fix tests
* Trigger CI
* Fix test
* Add names to params of encryption service interface
* Remove bus from CacheServiceImpl
* Add logging
* Add keys to logger
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
* Add missing key to logger
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
* Undo changes in markdown files
* Fix formatting
* Add context to secrets service
* Rename decryptSecureJsonData to decryptSecureJsonDataFn
* Name args in GetDecryptedValueFn
* Add template back to NewAlertmanagerNotifier
* Copy GetDecryptedValueFn to ngalert
* Add logging to pluginsettings
* Fix pluginsettings test
Co-authored-by: Tania B <yalyna.ts@gmail.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
Threema Gateway supports two types of IDs: Basic IDs (where the
encryption is managed by the API server) and End-to-End IDs (where the
keys are managed by the user).
This plugin currently does not support End-to-End IDs (since it's much
more complex to implement, because the encryption needs to happen
locally). Add a few clarifications to the UI.
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Alerting: Opsgenie send tags as extra properties
Allow users to select where to send notification tags when alerting via
OpsGenie. Supports sending tags as key/value details, concatenated
strings in tags or both.
Users will be able to see their tags as key/values under extra
properties in an alert on the Opsgenie UI. These key/values can
then be used in the platform for routing, templating etc.
* Configurable delivery to either tags, extra properties or both
* Default to current behaviour (tags only)
* Support both so users can transition from tags to details
Add docs and clean up references
* Alerting: Add additional arg for Opsgenie tests
The NewEvalContext function now requires a 'PluginRequestValidator' argument.
As our test does not use the validator we can specify 'nil' to satisfy the
function and allow our test to pass as expected.
* Alerting: Opsgenie doc fixes
Accept suggested changes for Opsgenie docs
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
* Alerting: Opsgenie provisioning settings docs
Add the new setting to the provisioning docs
* Alerting: Opsgenie doc typo correction
Move the comma (,) out of the preformatting tags for the setting value
* Alerting: Opsgenie refactor send switches
Refactor the send switches to be methods on the OpsgenieNotiefier
itself. This also cleans up the method names so that the code reads
a bit more logically as:
if we should send details: send details
if we should send tags: send tags
This avoids the calling code needing to care about passing the state
and allows an engineer working in the `createAlert` function to focus
on the results of applying the logic instead.
* Alerting: Opsgenie docs rename note
Rename the note heading to match the number to more clearly link them.
* Alerting: Opsgenie use standard reference to note
Refer to the note below as per recommendation and standards.
Fixes#30331
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
* adding state to the payload
* fix test
* fix linter
* documentation payload current state
* Apply suggestions from code review
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
* Make sure Metric field in Discord notification is never empty
Discord uniquely does not send the alert if the metric field is empty, which can happen in some cases, such as when the legend is {{hostname}}.
Signed-off-by: Levi Harrison <levisamuelharrison@gmail.com>
* Changed name of empty metric in Discord alert
Signed-off-by: Levi Harrison <levisamuelharrison@gmail.com>
Fixes behaviour of Notify that returns error when one of the dispatch
event return error, to maintain high availability, we should return error
when all dispatched events return error instead.
Fixes#30509
* Introduce PluginRequestValidator abstraction with a NoOp implementation
* Update PluginRequestValidator abstraction to use the dsURL instead
* Inject PluginRequestValidator into the HTTPServer and validate requests going through data source proxy
* Inject PluginRequestValidator into the BackendPluginManager and validate requests going through it
* Validate requests going through QueryMetrics & QueryMetricsV2
* Validate BackendPluginManager health requests
* Fix backend plugins manager tests
* Validate requests going through alerting service
* Fix tests
* fix tests
* goimports
Co-authored-by: Leonard Gram <leo@xlson.com>
* Add support for Sensu Go notification channel
Similar to current support for the older "Core" version of
Sensu, this commit add support for the newer version.
Closes#19908
Signed-off-by: Todd Campbell <todd@sensu.io>
* fix linter errors
Signed-off-by: Todd Campbell <todd@sensu.io>
* Apply suggestions from code review
PR review suggestions
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Fix no new variables error
* Replace convey testing with testify
Signed-off-by: Todd Campbell <todd@sensu.io>
* Wording suggestions
Signed-off-by: Todd Campbell <todd@sensu.io>
* Add docker compose environment for testing/maintenance
Signed-off-by: Todd Campbell <todd@sensu.io>
* Renamed and fixed docker-compose.yaml to work in devenv
Signed-off-by: Todd Campbell <todd@sensu.io>
* Change sensugo web UI port to 3080 so as not to conflict with grafana
Signed-off-by: Todd Campbell <todd@sensu.io>
* Apply suggestions from code review
Set the API key as a secure value.
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
* Add Sensu Go information to notifications doc
Signed-off-by: Todd Campbell <todd@sensu.io>
* Update pkg/services/alerting/notifiers/sensugo.go
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
* change assert to require for Error/NoError tests
Signed-off-by: Todd Campbell <todd@sensu.io>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
* 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>