Commit Graph

1451 Commits

Author SHA1 Message Date
Gilles De Mey
12fa9e56e6
Alerting: Fix max alerts (#87271) 2024-05-03 13:22:42 +02:00
Gilles De Mey
1d06f33a8e
Alerting: Prevent search from locking the browser (#87132) 2024-05-02 14:41:33 +03:00
Tom Ratcliffe
b0f6913ef6
Alerting: unify alert rule actions between list and detail view (#86071)
* Add mock method for getting a plugin

* Update tests to find "more" button via label

* Remove test for Silence action in rule details

* Unify alert rule actions to pull from same place

* Restore behaviour of only showing incident button when firing

* Fix identifier and pause permission/logic

* Remove TODO comment related to refactor

* Update snapshot for useAbilities

* Undo optional param

* Rename alert rule menu hook to component

* Refactor hook to component

* Rename Rule action buttons component

* Chore: update style syntax for RuleDetails

* Add tests for refactored alert rule menu

* Only re-fetch Grafana managed alerts after pausing/resuming

* Remove console log and check for extensions

* Improve share rule generation of GMA rules

* Rename component

* Update action

* Refactor plugins and fix tests

* lint

---------

Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2024-04-30 16:17:55 +01:00
Konrad Lalik
9369f07e32
Alerting: Immutable plugin rules and alerting plugins extensions (#86042)
* Add pluginsApi

* Add rule origin badge

* Make plugin provided rules read-only

* Add plugin settings caching, add plugin icon on the rule detail page

* Add basic extension point for custom plugin actions

* Add support for alerting and recording rule extensions

* Move plugin hooks to their own files

* Add plugin custom actions to the alert list more actions menu

* Add custom actions renderign test

* Add more tests

* Cleanup

* Use test-utils in RuleViewer tests

* Remove __grafana_origin label from the label autocomplete

* Remove pluginsApi

* Add plugin badge tooltip

* Update tests

* Add grafana origin constant key, remove unused code

* Hide the grafana origin label

* Fix typo, rename alerting extension points

* Unify private labels handling

* Add reactive plugins registry handling

* Update tests

* Fix tests

* Fix tests

* Fix panel tests

* Add getRuleOrigin tests

* Tests refactor, smalle improvements

* Rename rule origin to better reflect the intent

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2024-04-30 10:34:52 +02:00
Gilles De Mey
b679a32fad
Alerting: Allow deleting contact points referenced only by auto-generated policies (#86800) 2024-04-29 17:48:54 +01:00
Tom Ratcliffe
0a02508415 Add more robust error handling for stringifying API responses 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
a34d22dcbf Include alertmanager param on creation 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
e0ee0b09db Add test to check that a broken alertmanager will handle errors correctly 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
aa2f52a2a1 Tidy up error message handling 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
fd07b3d431 Link silence test handlers together more clearly and test more cases 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
a34c02fcf2 Address misc PR feedback 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
9860117399 Add more fine grained tag invalidation/providing for Silences 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
4fb1ac2bec Check error state more reliably 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
a0373c66c3 Add fallback for alertmanager alerts 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
9bf2cf0a52 Rename silences RTKQ tag 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
4d4bf39184 Check for server received body
This is not ideal! Preference would be to have a more robust mock server
that responds to the received silence and appends it to a stateful list for the test
and then resets afterwards
2024-04-29 14:15:48 +01:00
Tom Ratcliffe
0dc003aadc Split handlers out into separate files 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
f419c9b53a Add comment explaining reset in silences editor 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
df5c62b8ad Misc tidy up 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
21a3f4817a Add correct tag invalidation after creating a silence 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
cdfc6baea4 Remove unused fetchAlerts method 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
f397830098 Refactor Silences test 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
10fcd541e3 Add handlers to mock server 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
341449f4f5 Remove unused actions/reducers 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
a1d2a9670b Restructure Silences components for better separation of concerns 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
11ed882c84 Add mock server handlers necessary for Silences 2024-04-29 14:15:48 +01:00
Tom Ratcliffe
8f27ec2521 Add silences RTK Query API 2024-04-29 14:15:48 +01:00
Ashley Harrison
c151a97110
Chore: Enable no-unreduced-motion and fix errors (#86572)
* enable `no-unreduced-motion` in betterer

* move all animation calls inside handleReducedMotion

* fix violations + enable rule

* update rule README

* remove unnecessary transition from <Collapse>

* remove handleReducedMotion utility and add handleMotion to theme

* update to use new theme value

* handle Dropdown and IconButton

* handle AppChromeMenu and update lint message

* keep rotation at a reduced speed

* handle DashboardLoading
2024-04-29 13:12:36 +01:00
Sonia Aguilar
a68df4be88
Alerting: Skip flaky test (#86921)
Skip flacky test
2024-04-25 13:43:37 +01:00
Tom Ratcliffe
f43762f39a Remove (most) occurrences of HorizontalGroup within Alerting 2024-04-25 12:54:41 +01:00
Erik Sundell
0140dfdddf
Chore: Add e2e selectors to alert rule page (#86909)
wip
2024-04-25 10:00:11 +02:00
Tom Ratcliffe
0582e05f8f Add PoC for different MSW approach 2024-04-24 15:57:11 +01:00
Marcus Andersson
804c726413
PluginExtensions: Make the extensions registry reactive (#83085)
* feat: add a reactive extension registry

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* feat: add hooks to work with the reactive registry

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* feat: start using the reactive registry

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* feat: update the "command palette" extension point to use the hook

* feat: update the "alerting" extension point to use the hooks

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* feat: update the "explore" extension point to use the hooks

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* feat: update the "datasources config" extension point to use the hooks

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* feat: update the "panel menu" extension point to use the hooks

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* feat: update the "pyroscope datasource" extension point to use the hooks

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* feat: update the "user profile page" extension point to use the hooks

* chore: update betterer

* fix: update the hooks to not re-render unnecessarily

* chore: remove the old `createPluginExtensionRegistry` impementation

* chore: add "TODO" for `PanelMenuBehaviour` extension point

* feat: update the return value of the hooks to contain a `{ isLoading }` param

* tests: add more tests for the usePluginExtensions() hook

* fix: exclude the cloud-home-app from being non-awaited

* refactor: use uuidv4() for random ID generation (for the registry object)

* fix: linting issue

* feat: use the hooks for the new alerting extension point

* feat: use `useMemo()` for `AlertInstanceAction` extension point context

---------

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2024-04-24 09:33:16 +02:00
Sonia Aguilar
68564b1940
Alerting: Gops labels integration (#85467)
* Show list of labels on the alert rule form in a more visual way, and use a modal for managing them

* fix test

* Fix more tests

* Show orange badge when no labels are selected

* Remove unused datasource property in LabelsField

* Remove unused div and add comment

* Use button instead of icon for editing labels

* Use subform for labels

* Move logic fetching labels from different places in a separate hook

* Fix tests

* remove unused getLabelInput const in test

* Add ellispis and tooltip for long labels and move labels list in modal to the bottom

* Use text instead of badge when no using labels

* Fix tests after adding ellipsis and tooltip to the labels

* simplify styles

* Fix fetching values from gops when new key is used

* Address pr review comments

* Address pr review comments part2

* Fix tag on rtkq

* Remove color for no labels selected text

* Disable already used keys in the labels sub form

* Fix typo

* use the UseFieldArrayRemove type from react-hook-form

* Update some styles and text in the labels modal

* Address some review comments (nits)

* Address review comments part1

* Move logic getting labels in useCombinedLabels hook

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2024-04-23 14:38:31 +02:00
Ashley Harrison
fc45b56d9d
EmptyState: Apply call-to-action variant in core (#86448)
* apply empty state in a bunch of places

* fix unit tests

* put alert back on top

* add data-testids so e2e tests keep working

* remove info boxes

* fix annotations empty state alignment with new maxWidth
2024-04-22 17:01:24 +01:00
Konrad Lalik
7caa30bc2e
Alerting: Add plugins extension point to alerting home page (#85725)
* Add basic extension point to alerting home page

* Remove home page scenes app. Improve plugins styles

* Remove unused code

* Fix home page rendering when no plugins registered

* Add row-based integrations component

* Add missing margins

* Rollback the Box component changes

* Remove unused import
2024-04-22 13:42:11 +02:00
Konrad Lalik
1b930c341d
Alerting: Fix max_alerts field handling (#86651)
Fix max_alerts field parsing
2024-04-22 12:25:04 +02:00
Santiago
9ed616a7b3
Alerting: Fix typo ('Alert manager' -> 'Alertmanager') (#86608)
* Alerting: Fix typo ('Alert manager' -> 'Alertmanager')

* fix front-end test
2024-04-19 20:53:51 +02:00
Konrad Lalik
344cea1725
Alerting: Fix external Alertmanager settings payload (#86413)
* Remove helper properties from the AM config object

* Make the omitTemporaryIdentifiers a pure function

* Add formValuesToCloudReceiver test

* Remove immer produce to prevent object freezing
2024-04-18 15:55:13 +02:00
Tom Ratcliffe
a5c75c5ffb Remove explicit imports of whatwg-fetch from individual test files 2024-04-18 12:23:38 +01:00
Tom Ratcliffe
ab605e37df Remove unnecessary server.listen() 2024-04-18 09:04:53 +01:00
Tom Ratcliffe
ef5c4b69f3 Remove unused msw import 2024-04-18 09:04:53 +01:00
Tom Ratcliffe
de4510cc70 Reuse setupMswServer for alerting tests 2024-04-18 09:04:53 +01:00
Tom Ratcliffe
2674043cef Add whatwg-fetch and fixes to alerting tests that break when polyfill is added 2024-04-18 09:04:53 +01:00
Konrad Lalik
9614126cb7
Alerting: Fix instances link when served from subpath (#86432)
Fix instances link when served from subpath
2024-04-18 08:56:30 +02:00
Konrad Lalik
acd3e83c1c
Alerting: Take receivers into account when custom grouping Alertmanager groups (#86127)
* Take receiver into account when custom grouping Alertmanager alert groups

* Fix and add tests
2024-04-17 08:55:01 +02:00
Brendan O'Handley
f85470d652
Prometheus: Use the frontend package in Prometheus and remove feature toggle (#86080)
* add history links for monaco completion provider folder

* add history links for monaco query field folder

* add history links for components folder

* add history links for configuration folder

* add history links for dashboard json folder

* add history links for gcopypaste folder

* add history link for variableMigration

* add history link for querybuilder/components/metrics-modal folder

* add history link for querybuilder/components/promqail folder

* add history links for querybuilder/components folder

* add history links for querybuilder/hooks folder

* add history links for querybuilder/shared folder

* add history links for querybuilder folder

* add history links for querycache folder

* add history links for src folder

* use frontend package and custom auth in module.ts

* remove files and fix import issues

* remove usePrometheusFrontendPackage

* remove extra files

* update betterer

* remove extra files after rebase

* fix betterer for rebase

* fix e2e flakiness
2024-04-15 16:45:23 -05:00
Tobias Skarhed
f1f02207f2
Alerting: Improve heading accessibility (#85723)
* Change from h5 to Text component

* Fix goworksum error

* Add headings for contact points and notification policies

* Alert group h2

* Reset labels and move h2 to group by

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2024-04-12 16:19:47 +02:00
Tom Ratcliffe
ce5fc59d54 Use ActiveTab type for custom hook 2024-04-12 09:13:29 +01:00
Tom Ratcliffe
ccaf850c09 Refactor to useTabQueryParam 2024-04-12 09:13:29 +01:00