27 Commits

Author SHA1 Message Date
933ec4817f Alerting: Change the rule yaml data to reflect Prom-based rule format (#54520) 2022-09-08 12:52:36 +02:00
e46ee78bed Alerting: Add default input parameters for expressions (#51810) 2022-07-12 11:50:58 +02:00
97c9b25d44 Alerting: Skip the default data source if incompatible (#51452) 2022-06-28 10:05:53 +02:00
3c6e0e8ef8 Chore: ESlint import order (#44959)
* Add and configure eslint-plugin-import

* Fix the lint:ts npm command

* Autofix + prettier all the files

* Manually fix remaining files

* Move jquery code in jest-setup to external file to safely reorder imports

* Resolve issue caused by circular dependencies within Prometheus

* Update .betterer.results

* Fix missing // @ts-ignore

* ignore iconBundle.ts

* Fix missing // @ts-ignore
2022-04-22 14:33:13 +01:00
be3f52abb1 Alerting: grafana managed group names (#47785) 2022-04-20 11:41:33 +02:00
785145c045 Alerting: FGAC bug bash fixes (#47873)
* Improve new alert and new silence buttons permission handling

* Prevent loading alert rules when no sufficient permissions provided

* Improve add and edit rule permissions

* Add new rule CTA button for non-editors

* Update mock

* Fix imports
2022-04-19 18:43:33 +02:00
d52a6e3d3b Change 'grafana-expression' to ExpressionDatasourceRef.type so isExpr… (#43379)
* Change 'grafana-expression' to ExpressionDatasourceRef.type so isExpressionReference works

* use constant ref in tests

* import from package
2021-12-21 07:11:11 -07:00
7319efe077 Dashboard: replace datasource name with a reference object (#33817)
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Elfo404 <me@giordanoricci.com>
2021-10-29 10:57:24 -07:00
c43b82d44b make alert tab create alert button work with default datasource (#40334) 2021-10-14 09:40:43 +03:00
d62ca1283c PanelState: Introduce a new separate redux panel state not keyed by panel.id (#40302)
* Initial pass to move panel state to it's own, and make it by key not panel.id

* Progress

* Not making much progress, having panel.key be mutable is causing a lot of issues

* Think this is starting to work

* Began fixing tests

* Add selector

* Bug fixes and changes to cleanup, and fixing all flicking when switching library panels

* Removed console.log

* fixes after merge

* fixing tests

* fixing tests

* Added new test for changePlugin thunk
2021-10-13 08:53:36 +02:00
9d8f61c738 Alerting: allow creating/editing recording rules for Loki and Cortex (#38064) 2021-08-24 10:31:56 +02:00
3e124c854e Alerting: interpolate variables when creating alert rule from dashboard panel (#37201) 2021-08-10 10:59:48 +03:00
cac4b4b443 Alerting: small rule form ux improvements (#36941)
* dedupe folder option for existing grafana rules

* update test mocks

* change toggle to chevron for expanding error state ui

* fix some strict lint errors
2021-07-21 18:01:05 +03:00
781ab833bd Alerting: allow any "evaluate for" value >=0 in the alert rule form (#35807) 2021-06-21 15:54:42 +03:00
1ded9a37c1 Alerting: rename type to make it obvious what part of the code base it belongs to. (#34714)
* renamed grafana query to grafana alert query.

* renamed according to feedback in PR.
2021-05-27 12:29:10 +02:00
26638c23c3 Alerting: Lower the default timerange (#34280)
* use a custom default

* use default function
2021-05-19 09:42:40 +02:00
5721019573 Alerting: various rule form fixes (#34272) 2021-05-18 19:14:57 +03:00
8a0dbd0127 Alerting: enforce roles on frontend (#33997) 2021-05-17 11:15:17 +03:00
a26507e9c4 Alerting: update panel alert tab (#33850) 2021-05-17 10:39:42 +03:00
d2d13ea39a Alerting: miscllaneous UI fixes & improvements (#33734) 2021-05-06 11:21:58 +03:00
0006765a40 Alerting: Run queries (#33423)
* alertingqueryrunner first edition

* added so we always set name and uid when changing datasource.

* wip.

* wip

* added support for canceling requests.

* util for getting time ranges for expression queries

* remove logs, store data in state

* added structure for marble testing.

* change so the expression buttons doesnt submit form.

* fixed run button.

* replaced mocks with implementation that will set default query + expression.

* fixed so we set a datasource name for the default expression rule.

* improving expression guard.

* Update public/app/features/alerting/components/AlertingQueryEditor.tsx

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>

* fixed some nits.

* some refactoring after feedback.

* use grafanthemev2

* rename grafanatheme

* fixing so we convert to correct relative time range.

* added some more tests.

* fixing so duplicating query works.

* added some more tests without marbles.

* small refactoring to share code between runRequest and alerting query runner.

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-05-04 16:31:25 +02:00
9510c4f112 Alerting: Add alerting routes (#33179)
* Add amroutes

* Update table

* Recompute items when prop changes

* Update styling

* Updates

* Improvements

* Remove unnecessary line

* Updates

* Updates

* Improve code

* Add empty area component

* Move panel from root route to specific routing

* Update from master

* Update theme

* Implement save

* Fixes for PR review

* receiver -> contact point

* Fixes for PR review

* Fixes

* Add basic test

Co-authored-by: Domas <domasx2@gmail.com>
2021-05-04 16:57:11 +03:00
9de2f1bb8f Alerting: moving data source uid to query instead of model (#33416)
* initial commit.

* Some more improvements to the expression data source support.

* added tests to verify that time range picker and data source picker only is visible when callbacks is passed to row.

* fixing issue with filter in alerting list.

* minor refactoring.

* removed guarding code, should be fixed in  backend.

* cleaning the data query if we change to a different data source.
2021-04-29 15:10:14 +02:00
382cab6406 Alerting: misc fixes (#33070) 2021-04-19 12:53:02 +03:00
0491fe0a5c Alerting: separate namespace & group inputs for system alerts (#33026) 2021-04-16 14:57:33 +03:00
826d82fe95 Alerting: editing existing rules via UI (#33005) 2021-04-16 11:08:26 +03:00
282c62d8bf Alerting: Rule edit form (#32877) 2021-04-14 15:57:36 +03:00