Commit Graph

968 Commits

Author SHA1 Message Date
Tom Ratcliffe
20a1955026 Reuse StateTag for Paused state 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
0e87adbc97 Remove await from dispatch 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
ff8203a6cf Forward ref to StateTag so it can work with Tooltip 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
fb40c09eaf Reuse existing mock user method 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
2ca5e43a65 Remove superfluous alert from pause text 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
30471c340a Use verbose mutation from RTKQ for better IDE experience 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
28572102cf Use produce for pause payload generation and return early 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
12eeda5b7d Hide alert update success toast 2024-04-03 18:38:49 +01:00
Gilles De Mey
fbe43100aa add paused badge 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
30699dabec Move repeated Paused message into component 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
31fb80b29a Move MenuItemPaused to components folder 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
1e54899c6d Remove unneeded type 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
b037236b9c Add tag invalidation to updateRule mutation
...so the alert detail view updates appropriately
2024-04-03 18:38:49 +01:00
Tom Ratcliffe
9ca2f7bece Add pause/resume logic to menu items on Alert detail view 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
7d80373b5e Move repeated menu item logic for pausing rules into separate component 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
b84962ef3f Update tests to use existing mock server approach 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
5fbca0962e Fix import/export messing with Policy tests 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
bd06607a51 Fix typing check for paused rules in table 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
820f4f0ef5 Remove console logs, fix aggregate errors and add missing endpoint 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
8c313add00 Add test for resuming a paused alert rule 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
fef481efc3 Add mock data for paused rules 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
5505b72998 Add first pass of basic mock server for alerting usage 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
72a3142c3b Add pause/resume button with mutation for saving alert rule changes 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
9a416b8241 Fix potential display of "0" on rule details tab
When looking at the details tab of an alert rule, the last evaluation could potentially display as `0` due to falsy checks on React rendering
2024-04-03 18:38:49 +01:00
Tom Ratcliffe
a94c3d63cc Update utils for determining paused state of a rule 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
7fd9cbbfb5 Export alerts limit for reuse when re-fetching rules list 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
1a5d227e05 Hide "firing for time" if a rule is paused 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
93fd11fe86 Update alert state tag to display Paused as its own "state" 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
a881e7e404 Display info message on rule detail view when a rule is paused 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
31be1231cf Move max width from rule editor parent 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
d0dcb72683 Display info message on rule form when a rule is paused 2024-04-03 18:38:49 +01:00
Tom Ratcliffe
e5a6dff801 Add mutation method to update a rule 2024-04-03 18:38:49 +01:00
Leon Sorokin
d601acac3a
VizTooltips: Remove old tooltips and annotations (#84420)
Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
2024-04-02 15:32:46 -05:00
Torkel Ödegaard
e90b87589f
ModalsContext: Unify modals context and manager (#84916)
* ModalsContext: Unify modals context and manager

* Clear on location change

* fixes

* Update

* use generics to avoid anys

---------

Co-authored-by: joshhunt <josh@trtr.co>
2024-03-28 13:26:57 +01:00
Gilles De Mey
a574db6f64
Alerting: Fix removing nested policy (#85242) 2024-03-27 13:58:59 +02:00
Gilles De Mey
90a1e8a82f
Alerting: Make hovercard accessible (#85195) 2024-03-27 10:05:30 +01:00
Torkel Ödegaard
b20da139ad
DashboardScene: Show insights icon (#84877)
* DashboardScene: Show insights icon

* Update

* Create separate group for precence indicators

* fix

* Update

* fix tests
2024-03-22 09:46:29 +01:00
Gilles De Mey
8c9ba97642
Alerting: Support PromQL-style matchers (#84672) 2024-03-21 14:11:18 +01:00
Gilles De Mey
4c247f959b
Alerting: Fix broken panelId links (#84839) 2024-03-21 13:58:34 +01:00
Erik Sundell
29d4f6a217
Datasource: Change query filtering (#84656)
* call filterQuery from queryrunner

* test query hide filtering

* fix more broken tests

* lint errrors

* remove redundant filterQuery call

* skip filter in variable queries

* fix broken cypress test

* change tooltip text

* fix translations

* fix comments

* do not execute query is targets are empty

* add more tests

* remove unsued import

* update translations

* revert id change

* change header text

* update comment for hide prop

* rename hide query prop

* change tooltip and introduce different toggle state text

* update tests

* update comment and regenerate types

* run extract again

* fix broken e2e test

* track event

* fix build issues

* revert changes in wire file
2024-03-21 13:39:39 +01:00
Alex Khomenko
b41ad688f2
Alerting: Remove deprecated InputControl (#84793) 2024-03-21 12:59:41 +02:00
Laura Benz
d8a116e696
ReturnToPrevious: Add e2e test (#83115)
* feat: add incomplete unit test

* refactor: add idea for unit test

* feat: create new e2e test

* feat: add some steps

* feat: add comment

* feat: complete prep work

* feat: complete clean up

* rebase

* feat: add more steps to test flow

* refactor: remove unit test

* refactor: clean up

* refactor: create a provisioned alert rule

* refactor: change location and content

* refactor: e2e test

* refactor: betterer

* refactor: move provisioned alert rule

* refactor: make provisioning file available remote

* refactor: clean up test

* refactor: move provisioned alert rule

* refactor: remove wait()

* feat: restructure first test and add more tests

* feat: add another provisioned alert rule

* feat: add a new test

* feat: complete new test

* refactor: replace data-testid in alert rules

* refactor: replace data-testid

* refactor: fix tests for drone

* refactor: fix third test after review

* refactor: fix last test

* temp

* refactor: improve some things

* refactor: adjust unit tests

* refactor: remove assertions for alert rule details view

* refactor: remove assertions

* refactor: add check for button text

* refactor: remove session storage

* refactor: apply changes from code review

* refactor: add codeowner

* refactor

* refactor

* refactor: clean up

* refactor: clean up

* refactor: clean up

* refactor: increase pa11y threshold for /alerting/list
2024-03-21 09:05:51 +01:00
Gilles De Mey
5a57ff1307
Alerting: Preserve newlines and whitespace for Prometheus and Loki queries (#84755) 2024-03-19 19:38:04 +02:00
Sonia Aguilar
b38436eeb0
Alerting: Fix used badge in contact points list (#84714)
Fix used badge in contact points list
2024-03-19 13:30:06 +01:00
Ashley Harrison
15194b41b4
Dropdown: Fix keyboard accessibility (#84683)
* fix dropdown keyboard a11y

* remove unnecessary css

* restore tabIndex to keep linting happy

* use Box in Menu

* fix unit test
2024-03-19 10:22:17 +00:00
Tom Ratcliffe
296f4219f8 Add missing external link for TextLink 2024-03-18 16:50:30 +00:00
Tom Ratcliffe
8f50ccbb7c Fix display of Alert diagram in Safari 2024-03-18 16:50:30 +00:00
Tom Ratcliffe
b3e9a6d0b3 Use Text component more consistently in GettingStarted 2024-03-18 16:50:30 +00:00
Tom Ratcliffe
fb2ba574c6 Convert getting started styles to object syntax 2024-03-18 16:50:30 +00:00
Tom Ratcliffe
30a791d77a Tidy up styling for Getting Started page and use @grafana/ui components 2024-03-18 16:50:30 +00:00
Tom Ratcliffe
2e2a5bca11 Remove unused showWelcomeHeader prop 2024-03-18 16:50:30 +00:00
Tom Ratcliffe
83464781be Remove video from Alert Getting Started page 2024-03-18 16:50:30 +00:00
Chris Bedwell
9c7a5ed506
Alerting: Fix infinite re-render when linking to alert redirect page (#84305)
fix: move where the fallback array is initialized so not to create an infinite re-render
2024-03-15 22:57:31 +00:00
Gilles De Mey
1ce2ae427f
Alerting: Query and conditions improvements (#83426) 2024-03-15 18:37:11 +02:00
Gilles De Mey
85bd116a10
Alerting: Fix optional fields requiring validation rule (#84584)
fixes #84296
2024-03-15 15:49:05 +01:00
Sonia Aguilar
1f13a14815
Alerting: Fix wrong use of empty list in times field in the UI (#84179)
* Fix wrong use of empty list in times field in the UI

* Add tooltip for disable switch

* Show disabled badge in mute timings

* Disable time ranges when disabling time interval in the UI

* PR review comments

* remove tooltip for the field as it does not register it correctly

* remove wrong code line

* Add comment

* Address PR review comments
2024-03-15 15:48:16 +01:00
Sonia Aguilar
fa9f692707
Alerting: Fix AlertsFolderView not showing rules when using nested folders (#84465)
* Fix AlertsFolderView not showing rules when using nested folders

* Fix tests
2024-03-15 14:08:09 +01:00
Gilles De Mey
8765c48389
Alerting: Remove legacy alerting (#83671)
Removes legacy alerting, so long and thanks for all the fish! 🐟

---------

Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
Co-authored-by: Sonia Aguilar <soniaAguilarPeiron@users.noreply.github.com>
Co-authored-by: Armand Grillet <armandgrillet@users.noreply.github.com>
Co-authored-by: William Wernert <rwwiv@users.noreply.github.com>
Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2024-03-14 15:36:35 +01:00
Gilles De Mey
336acaf0bf
Alerting: Promote new alerting detail view (#84277) 2024-03-14 15:18:01 +01:00
Gilles De Mey
e6150a792a
Alerting: Always omit IDs from all routes when updating notification policy tree (#84304) 2024-03-12 18:04:49 +02:00
William Wernert
10dc6c6d75
Alerting: Add "Keep Last State" backend functionality (#83940)
* Implement keep last state for state transitions

* Respect For duration when keeping state

* Only keep transition from recording an annotation

* Add keep last state option for nodata/error in UI
2024-03-12 10:00:43 -04:00
Gilles De Mey
388e0c27f2
Alerting: Allow inserting before or after existing policy (#83704) 2024-03-12 13:28:37 +01:00
Sonia Aguilar
0e7c0d25fe
Alerting: Add test for creating an alert rule with simplified routing. (#80610)
* Add test for creating an alert rule with simplified routing

* Fix mocking folders after merging from main (folder uid change)
2024-03-11 08:47:56 +01:00
Sonia Aguilar
7a741a31bd
Alerting: Track when switching from simplified routing to policies routing or vice versa (#83108)
Track when switching from simplified routing to policies routing or vice versa
2024-03-11 08:47:22 +01:00
Gilles De Mey
f5dab6b5a5
Alerting: Refactor analytics to use pushMeasurements (#83850) 2024-03-07 16:41:38 +01:00
Pepe Cano
9c520acf9c
Alerting: Minor changes to UI help text and descriptions (#84023) 2024-03-07 12:33:16 +01:00
Konrad Lalik
a4acd9d204
Alerting: Improve alert list panel and alert rules toolbar permissions handling (#83954)
* Improve alert list panel and alert rules toolbar permissions handling

* Refactor permission checking, add tests

* Remove unneccessary act wrapper

* Fix test error
2024-03-07 12:30:37 +01:00
Konrad Lalik
708aeb0682
Alerting: Pass queryType parameter to the query model in recording rules preview (#83950) 2024-03-06 11:42:28 +01:00
Gilles De Mey
582fd53fac
Alerting: Implement correct RBAC checks for creating new notification templates (#83767) 2024-03-01 18:09:14 +01:00
Gilles De Mey
fc10600ca5
Alerting: Fix editing Grafana folder via alert rule editor (#83771) 2024-03-01 18:08:42 +01:00
Gilles De Mey
675b7debe7
Alerting: Assume rule not found when everything is undefined (#83774) 2024-03-01 18:08:17 +01:00
Santiago
2964901ea6
Chore: Fix typo in template not found error message (#83778) 2024-03-01 18:04:20 +01:00
Konrad Lalik
11d341d2bb
Alerting: Add escape and quote support to the matcher name (#83601)
Add escape and quote support to the matcher name
2024-03-01 11:34:58 +01:00
Leon Sorokin
42b55aedbc
DataLinks: Handle getLinks() regen during data updates and frame joining (#83654) 2024-02-29 21:46:53 +02:00
Laura Fernández
f0822e0aef
ReturnToPrevious: Add this functionality to the "Go to panel" button on Alert rules (#83630)
Add RTP to the 'Go to panel' button
2024-02-29 12:19:59 +01:00
Konrad Lalik
183a42b7f6
Alerting: Improve alert rule and search interaction tracking (#83217)
* Fix alert rule interaction tracking

* Add search component interaction tracking

* Add fine-grained search input analytics
2024-02-28 16:52:56 +01:00
Sonia Aguilar
ed3c36bb46
Alerting: Use time_intervals instead of the deprecated mute_time_intervals in a… (#83147)
* Use time_intervals instead of the deprecated mute_time_intervals in alert manager config

* don't send mute_time_intervals in the payload

* Add and update tests

* Fix usecase when having both fields in response from getting alert manager config

* Use mute_timings for grafana data source and both for cloud data source when deleting mute timing

* Use mute_timings for grafana data source and both for cloud data source when saving a new or existing alert rule

* Address first code review

* Address more review comments
2024-02-28 15:21:00 +01:00
Scott Lepper
70009201d4
Expressions: Sql expressions with Duckdb (#81666)
duckdb temp storage of dataframes using parquet and querying from sql expressions
---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-02-27 16:16:00 -05:00
Takashi Idobe
f209a5a8b8
fix typos (#83414) 2024-02-26 10:52:44 -07:00
Ashley Harrison
49e18a3e7a
Chore: replace react-popper with floating-ui in Popover (#82922)
* replace react-popper with floating-ui in Popover

* update HoverCard

* fix unit tests

* mock useTransitionStyles to ensure consistent unit test results
2024-02-23 15:00:24 +00:00
Konrad Lalik
cc9ff3f8c9
Alerting: Add Loki ASH tests checking proper rendering of timeline chart component (#83235)
Add Loki ASH tests checking proper rendering of timeline chart component
2024-02-23 09:19:16 +01:00
Sonia Aguilar
2a1873f038
Alerting: Fix saving evaluation group. (#83188)
fix saving evaluation group
2024-02-22 14:29:57 +01:00
Jack Westbrook
0dcdfc261b
Monaco Editor: Load via ESM (#78261)
* chore(monaco): bump monaco-editor to latest version

* feat(codeeditor): use esm to load monaco editor

* revert(monaco): put back previous version

* feat(monaco): setup MonacoEnvironment when bootstrapping app

* feat(monaco): load monaco languages from registry as workers

* feat(webpack): clean up warnings, remove need to copy monaco into lib

* fix(plugins): wip - remove amd loader workaround in systemjs hooks

* chore(azure): clean up so QueryField passes typecheck

* test(jest): update config to fix failing tests due to missing monaco-editor

* test(jest): update config to work with monaco-editor and kusto

* test(jest): prevent message eventlistener in nodeGraph/layout.worker tripping up monaco tests

* test(plugins): wip - remove amd related tests from systemjs hooks

* test(alerting): prefer clearAllMocks to prevent monaco editor failing due to missing matchMedia

* test(parca): fix failing test due to undefined backendSrv

* chore: move monacoEnv to app/core

* test: increase testing-lib timeout to 2secs, fix parca test to assert dom element

* feat(plugins): share kusto via systemjs

* test(e2e): increase timeout for checking monaco editor in exemplars spec

* test(e2e): assert monaco has loaded by checking the spinner is gone and window.monaco exists

* test(e2e): check for monaco editor textarea

* test(e2e): check monaco editor is loaded before assertions

* test(e2e): add waitForMonacoToLoad util to reduce duplication

* test(e2e): fix failing mysql spec

* chore(jest): add comment to setupTests explaining need to incresae default timeout

* chore(nodegraph): improve comment in layout.worker.utils to better explain the need for file
2024-02-22 12:31:40 +01:00
Konrad Lalik
b02183e9ac
Alerting: Fix dashboard nav drawers disappearing (#82890)
Add DashNav modal renderer to handle modals rendered from Toolbar buttons
2024-02-22 10:16:27 +01:00
Alex Khomenko
5132828a2b
Chore: Remove Form usage from notification policies (#81758)
* Chore: Replace Form component usage in EditDefaultPolicyForm.tsx

* Chore: Replace Form component usage in EditNotificationPolicyForm.tsx

* Remove ts-ignore
2024-02-21 18:14:49 +02:00
Laura Fernández
c237a39020
ReturnToPrevious: Check the state of the RTP feature toggle in the hook (#83087) 2024-02-20 15:05:12 +01:00
Gilles De Mey
f71f54c872
Alerting: Updates to recording rules (#82329) 2024-02-16 17:13:43 +01:00
Sonia Aguilar
5de17432f5
Alerting: Add pagination and improved search for notification policies (#81535) 2024-02-16 17:11:03 +01:00
Ashley Harrison
ffb9a4de4a
Chore: some test type fixes (#82889)
* some test type fixes

* ignore table-old since it's an angular panel that will be removed
2024-02-16 14:35:26 +00:00
Sonia Aguilar
7b415cf79e
Alerting: Skip fetching receivers status in the alert rule form (#82892) 2024-02-16 15:15:02 +01:00
Gilles De Mey
248031d007
Alerting: Show legacy provisioned alert rules warning (#81902) 2024-02-16 14:47:03 +01:00
Konrad Lalik
44ecb26ea1
Alerting: Clarify provisioning export types (#82420)
Add provisioning type export Alert
2024-02-14 15:04:15 +01:00
Sonia Aguilar
8dc1cd6d59
Alerting: Fix reading props from undefined in settings (#82418)
* Fix reading props from undefined in settings

* Make settings optional in GrafanaManagedReceiverConfig type
2024-02-15 00:38:20 +11:00
Ashley Harrison
cf65d91ee9
Chore: upgrade to msw v2 (#82270)
* Update dependency msw to v2

* close

* minor fixes

* fetch import changes

* fix some alerting tests

* fix another alerting test

* fix systemjs tests

* don't return undefined in json mocks

* don't return undefined in json response

* add type

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-14 13:16:44 +00:00
Gilles De Mey
70aa8fe6b3
Alerting: Fix slack double pound and email summary (#82333) 2024-02-14 13:12:04 +01:00
Gilles De Mey
f6ea39ff00
Alerting: Prevent state badge from wrapping (#82330) 2024-02-14 12:12:05 +01:00
Sonia Aguilar
92eb2c900e
Alerting: Use VirtualizedSelect for ContactPointSelector (#82345)
* Use VirtualizedSelect for ContactPointSelector

* Conditionally use virtualized to keep description when having less than 500 contact points
2024-02-14 12:43:46 +02:00
Alex Khomenko
55d17c7fcb
Chore: Remove Form usage from alerting config components (#81681)
* Chore: Replace InputControl in BaseSettings

* Chore: Replace InputControl and FormAPI in OptionElement.tsx

* Update ConfigEditor.tsx
2024-02-13 12:51:54 +02:00
Sonia Aguilar
730e1d2485
Alerting: Fix folder and rule name in groupBy for simplified routing (#82148)
* Fix folder and rule name in groupBy for simplified routing

* Review suggestions

* Use proper type for MultiValueRemove props

* hoist getting groupBy count

* Use watch instead of getValues

* Bring back validation for required fields
2024-02-12 12:45:29 +01:00
Gilles De Mey
70fc603d26
Alerting: Improve 404 and other HTTP request error handling (#82249) 2024-02-12 12:17:19 +01:00