David Parrott
20d356947c
set state correctly and test ( #34680 )
2021-05-26 11:37:42 -07:00
Ganesh Vernekar
d69c21acb6
NGAlert: Update the default template to include more URLs ( #34715 )
...
* NGAlert: Update the default template to include more URLs
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
* Fix tests
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-05-26 16:49:39 +02:00
Ganesh Vernekar
b168223029
NGAlert: Add integration tests for remaining notification channels ( #34662 )
...
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-05-26 16:33:55 +05:30
Marcus Andersson
e19b3df1a9
Alerting: added possibility to preview grafana managed alert rules. ( #34600 )
...
* starting to add eval logic.
* wip
* first version of test rule.
* reverted file.
* add info colum to result to show error or (with CC evalmatches)
* fix labels in evalmatch
* fix be test
* refactored using observables.
* moved widht/height div to outside panel rendere.
* adding docs api level.
* adding container styles to error div.
* increasing size of preview.
Co-authored-by: kyle <kyle@grafana.com>
2021-05-26 10:06:28 +02:00
Owen Diehl
0e0ed43153
Alerting/testing promql extraction ( #34665 )
...
* promql compat for marshaling
* extracts upstream instant queries into data frame for alerting
* eval string parity
2021-05-25 11:54:50 -04:00
Sofia Papagiannaki
b48832c0f7
[Alerting]: alertmanager notifier fixes ( #34575 )
2021-05-24 16:09:29 +03:00
Sofia Papagiannaki
23939eab10
[Alerting]: namespace fixes ( #34470 )
...
* [Alerting]: forbid viewers for updating rules if viewers can edit
check for CanSave instead of CanEdit
* Clear ngalert tables when deleting the folder
* Apply suggestions from code review
* Log failure to check save permission
Co-authored-by: gotjosh <josue@grafana.com>
2021-05-20 15:49:33 +03:00
gotjosh
7b04278834
Alerting: Opsgenie notification channel ( #34418 )
...
* Alerting: Opsgenie notification channel
This translate the opsgenie notification channel from the old alerting
system to the new alerting system with a few changes:
- The tag system has been replaced in favour of annotation.
- TBD
- TBD
Signed-off-by: Josue Abreu <josue@grafana.com>
* Fix template URL
* Bugfig: dont send resolved when autoClose is false
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
* Fix integration tests
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
* Fix URLs in all other channels
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-05-20 10:12:08 +02:00
David Parrott
7a83d1f9ff
Alerting resend delay for sending to notifiers ( #34312 )
...
* adds resend delay to avoid saturating notifier
* correct method signatures
* pr feedback
2021-05-19 22:15:09 +02:00
Owen Diehl
8f350bc353
actually register metrics this time ( #34444 )
2021-05-19 22:09:12 +02:00
Ganesh Vernekar
533be16787
NGAlert: Add Threema notification channel ( #34159 )
...
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-05-19 20:20:52 +02:00
Ganesh Vernekar
b2e84277a3
NGAlert: Add Kafka notification channel ( #34156 )
...
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-05-19 20:02:09 +02:00
Ganesh Vernekar
ad1d0ae0bf
NGAlert: Add VictorOps notification channel ( #34161 )
...
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-05-19 19:52:14 +02:00
Ganesh Vernekar
fb9223ab42
NGAlert: Add Line notification channel ( #34157 )
...
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-05-19 19:04:48 +02:00
Domas
54c33c6cdd
Alerting: update email template ( #34205 )
2021-05-19 18:58:31 +02:00
Ganesh Vernekar
01e0faf800
NGAlert: Add GoogleChat notification channel ( #34153 )
...
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-05-19 18:24:04 +02:00
David Parrott
a0f175c7a5
also don't allow negative intervalseconds ( #34319 )
2021-05-19 09:05:32 -07:00
David Parrott
b9f4ec2030
Add discord notifier channel and test ( #34150 )
...
* Add discord notifier channel and test
* Correct payload
* remove print statement
* PR feedback and update due to changes in main
* Add discord notifier channel and test
* Correct payload
* remove print statement
* PR feedback and update due to changes in main
* update constructor and tests
* group imports sensibly
* Fix lint
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-05-19 17:31:55 +02:00
Sofia Papagiannaki
a79a4838b8
[Alerting]: Add Pushover integration with the alert manager ( #34371 )
...
* [Alerting]: Add Pushover integration with the alert manager
* lint
* Set boundary only for tests
* Remove title field
* fix imports
2021-05-19 16:48:46 +02:00
Owen Diehl
1d2febfa85
[Alerting] Route validations ( #34393 )
...
* more routing validation
* go mod
* recursive route validations
2021-05-19 10:36:28 -04:00
Arve Knudsen
9dfaa037d1
Alerting: Migrate Alertmanager notifier ( #34304 )
...
* Alerting: Port Alertmanager notifier to v8
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-05-19 15:27:41 +02:00
Owen Diehl
d6c4c2fcd5
[Alerting] Ensure upstream validations are run ( #34333 )
...
* use embedded validations via noop yaml unmarshaler
* lint
* fixes integration tests now that groupings are handled
2021-05-19 06:22:44 -04:00
Owen Diehl
c48c701791
adds missing metric name ( #34307 )
2021-05-18 17:24:38 -04:00
David Parrott
25485100b0
Alerting: Trim results when at processing instead of on ticker ( #34248 )
...
* Trim results when at processing instead of on ticker
* User RWMutex correctly
* remove comment
2021-05-18 10:56:14 -07:00
David Parrott
bbb7bbf891
Alerting: Remove back end logic for supporting KeepLastState ( #34242 )
...
* Removed back end logic for supporting KeepLastState
* Map keep_state correctly in migrations
2021-05-18 10:55:43 -07:00
Sofia Papagiannaki
ff112f07e3
[Alerting]: Add Sensu Go integration with the alert manager ( #34045 )
...
* [Alerting]: Add sensugo notification channel
* Apply suggestions from code review
Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
* Do not include labels with concatenated rule UID and names
* Modifications after syncing with main
Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-05-18 17:31:51 +03:00
Sofia Papagiannaki
11243dec14
[Alerting]: Assign UUID to grafana receivers ( #34241 )
...
* [Alerting]: Assign UUID to grafana receivers
* Apply suggestions from code review
* Add test for updating invalid receiver
Co-authored-by: Domas <domasx2@gmail.com>
2021-05-18 17:31:00 +03:00
Kyle Brandt
63b2dd06a5
Alerting: Set "value" with evalmatches in G Managed ( #34075 )
...
When, and currently only when using a classic condition, evaluation information is added (which is like the EvalMatches from dashboard alerting).
This is returned via the API and can be included in notifications by reading the `__value__` label attached `.Alerts` in the template. It is a string.
2021-05-18 09:12:39 -04:00
Ganesh Vernekar
89c2b5e863
NGAlert: Remove unwanted fields from notification channel config ( #34036 )
...
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-05-18 10:04:47 +02:00
gotjosh
6384f86fb9
Alerting: Allow the notifier to log ( #34232 )
...
* Alerting: Allow the notifier to log
The notifier upstream code uses go-kit as its logging library. The
grafana specific logger is not compatible with this API. In this PR, I
have created a wrapper that implements io.Writer to make them
compatible.
2021-05-17 18:06:47 +01:00
Kyle Brandt
331991ca10
UAlerting: Increase default max datapoints ( #34223 )
...
Change const value from 100 to 43200 (12 hours at 1sec interval)
2021-05-17 18:46:52 +02:00
Ganesh Vernekar
d5ae55c5dd
NGAlert: Add message field to email notification channel ( #34044 )
...
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-05-17 16:05:09 +05:30
Owen Diehl
1367f7171e
Alerting/ruler metrics ( #34144 )
...
* adds active configurations metric
* rule evaluation metrics
* ruler metrics
* pr feedback
2021-05-14 16:13:44 -04:00
gotjosh
eb74994b8b
Alerting: Modify configuration apply and save semantics - v2 ( #34143 )
...
* Save default configuration to the database and copy over secure settings
2021-05-14 19:49:54 +01:00
Owen Diehl
fc90c36d50
removes unused db method ( #34082 )
2021-05-13 20:28:10 +02:00
Owen Diehl
baca873a84
extracts alertmanager from DI, including migrations ( #34071 )
...
* extracts alertmanager from DI, including migrations
* includes alertmanager Run method in ngalert
* removes 3s test shutdown timeout
* lint
2021-05-13 14:01:38 -04:00
Ganesh Vernekar
ec3214bac2
NGAlert: Add integration tests for notification channels ( #33431 )
...
* NGAlert: Add integration tests for notification channels
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
* Fix the failing tests
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
* Fix review comments
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
* Override creation of rule UID, remove only namespace UID
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-05-13 22:58:19 +05:30
Kyle Brandt
babb17afd6
Alerting/Chore: Move tests from tests package ( #34059 )
...
Instead put in package folder but with package name suffixed with _test
This enables code coverage within the pkg while still allow the tests to operate from external to package perspective (only exported things).
2021-05-13 10:05:33 -04:00
Ganesh Vernekar
5f44ccff0c
NGAlert: Fix unit test to write files in temporary directory ( #34032 )
...
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-05-13 16:08:12 +05:30
Kyle Brandt
3da8db7f3f
Alerting: Run table migrations regardless of feature flag and move out of service ( #33996 )
2021-05-12 14:39:48 -04:00
Owen Diehl
3b06f52bab
Alerting/allow empty receiver ( #33962 )
...
* simplifies yaml unmarshaling: PostableApiReceiver
* allow empty receiver type
* allows name only receivers (blackhole)
* better receiver type parsing
* linting
2021-05-12 07:58:16 -04:00
Kyle Brandt
a735c51202
Alerting/Chore: Backend remove def_ columns from instance ( #33875 )
...
rename def_uid and def_org_id to rule_uid and rule_org_id on the alert_instance table and drops the definition table.
2021-05-12 07:17:43 -04:00
Ganesh Vernekar
8d442c9b44
NGAlert: Fix templating and remove unwanted default templates ( #33918 )
...
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-05-12 15:13:43 +05:30
Sofia Papagiannaki
f4750fb3c8
[Alerting]: Alertmanager API apply permissions ( #33843 )
...
* [Alerting]: Alertmanager API apply permissions
* Apply suggestions from code review
2021-05-11 11:31:38 +03:00
Owen Diehl
e18ca8f6f2
enforce receivers align with backend type when posting AM config ( #33877 )
2021-05-10 16:58:41 -04:00
Sofia Papagiannaki
1c58fd380f
[Alerting]: store encrypted receiver secure settings ( #33832 )
...
* [Alerting]: Store secure settings encrypted
* Move encryption to the API handler
2021-05-10 15:30:42 +03:00
David Parrott
e58aca2d20
Alerting: remove instances from db and cache on rule update ( #33722 )
...
* remove instances from db and cache on rule update
* fix panic
* rename
2021-05-06 18:39:34 +02:00
Kyle Brandt
fae093bbe2
Alerting: Fix state cache getOrCreate panic ( #33777 )
2021-05-06 14:35:52 +02:00
Owen Diehl
a5ae8cf377
Unredact/secret ( #33723 )
...
* no longer redacts GETing proxied AM configs
* removes unused testfile
* testware fix
* consistently roundtrips yaml<>json and doesnt redact secrets
* lint
2021-05-05 16:21:53 -04:00
Ganesh Vernekar
1b8c0ce88b
NGAlert: Fix some TODOs in notification channels ( #33739 )
...
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-05-05 17:48:40 +05:30