This PR has two steps that together create a functional dry-run capability for the migration.
By enabling the feature flag alertingPreviewUpgrade when on legacy alerting it will:
a. Allow all Grafana Alerting background services except for the scheduler to start (multiorg alertmanager, state manager, routes, …).
b. Allow the UI to show Grafana Alerting pages alongside legacy ones (with appropriate in-app warnings that UA is not actually running).
c. Show a new “Alerting Upgrade” page and register associated /api/v1/upgrade endpoints that will allow the user to upgrade their organization live without restart and present a summary of the upgrade in a table.
* Separate overlapping legacy and UA alerting routes
api/alert-notifiers, alerting/list, and alerting/notifications existed in both
legacy and UA.
Rename legacy route paths and nav ids to be independent of UA ones.
Backend:
* Update the Grafana Alerting engine to provide feedback to HysteresisCommand. The feedback information is stored in state.Manager as a fingerprint of each state. The fingerprint is persisted to the database. Only fingerprints that belong to Pending and Alerting states are considered as "loaded" and provided back to the command.
- add ResultFingerprint to state.State. It's different from other fingerprints we store in the state because it is calculated from the result labels.
- add rule_fingerprint column to alert_instance
- update alerting evaluator to accept AlertingResultsReader via context, and update scheduler to provide it.
- add AlertingResultsFromRuleState that implements the new interface in eval package
- update getExprRequest to patch the hysteresis command.
* Only one "Recovery Threshold" query is allowed to be used in the alert rule and it must be the Condition.
Frontend:
* Add hysteresis option to Threshold in UI. It's called "Recovery Threshold"
* Add test for getUnloadEvaluatorTypeFromCondition
* Hide hysteresis in panel expressions
* Refactor isInvalid and add test for it
* Remove unnecesary React.memo
* Add tests for updateEvaluatorConditions
---------
Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com>
* use floating-ui instead of react-popper-tooltip in Tooltip
* remove useTheme2 usage
* remove escape handling logic in favour of useDismiss
* don't need this useEffect anymore
* convert Toggletip to use floating-ui
* use explicit version
* convert OperationInfoButton to use Toggletip
* convert nestedFolderPicker to use floating-ui
* convert Dropdown to use floating-ui and remove react-popper-tooltip
* fix Modal/Tooltip tests
* revert to old toggletip behaviour
* revert OperationInfoButton to not use Toggletip
* add mock for requestAnimationFrame
* remove requestAnimationFrame mock
* remove fakeTimers where they're not used
* use floating-ui in ButtonSelect
* Fix filters unit tests
* only attach description if label is different
* use 'fixed' strategy for Toggletip
* use stroke and strokeWidth
* set move: false to only show the tooltip if a hover event occurs
* update type for onClose
* Canvas: Add Zoom
* Scale selecto components based on zoom state
* Fix pan by reverting to 3.1.0 for zoom-pan
* Update to latest library that fixes pan regression
* Add mini map to canvas pan zoom
* Fix selecto and anchors on hover
* Update naming to be more clear
* Switch back to contentComponent
* Apply transformScale to drag and resize
* Update connection source and target scaling
* Add option to display mini map
* Update yarn lock
* Revert "Update yarn lock"
This reverts commit 3d1dd65d57.
* Set yarn lock to main
* Revert "Set yarn lock to main"
This reverts commit 64bc50557e.
* Update to Yarn 4
* Add react-zoom-pan-pinch
* Update react-zoom-pan checksum
* Revert changes to json files
* Remove last line of api merged
* Remove last lines of all impacted jsons
* Update home json
* Update coordinate calc function to include scale
* Fix types in coordinate calc function
* Fix util calculation for transform
* Fix arrow anchor shift behavior
* Fix scale offset when adding elements during zoom
* Fix drag of selected group during zoom
* Add feature flag for canvas pan zoom
* Revert "Add feature flag for canvas pan zoom"
This reverts commit b026e31d8d.
* Regenerate feature flag after merge
* Apply feature flag to enable pan zoom wrappers
* Add mini map toggle behind feature flag
* Simplify minimap behavior
* Update feature flag registry
* Set minimap to false by default
* fix gen-cue
* Set toggles gen to main
Add blank line to toggle gen csv
* Add canvas pan zoom to csv
* Remove old comment
* Change ref parameter to be more descriptive
* Rename visibleFun to be more descriptive
* Consolidate transformScale transformRef in util
* Remove non-null assertion on connection parentRect
* Consolidate parentRect null coalescing into object
* Remove minimap and change toggle
* Add controls inline help for pan and zoom
* Clean up mouse events
* Pull scale out of ref and isolate transform
* Remove transform ref from scene div
* Fix context menu visible behavior
* Fix connections and update util functions
* Move transform component instance to util
* fix backend test
* minor updates
* Clean up connections / fix minor bug where offset of arrow wasn't being calculated correctly
* missed connection code cleanup
* cleanup scene code a bit more
* actually fix backend test
* move eslint disable line closer to actual issue
---------
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
* wip
* WIP: Added some actions, timings and grouping
* WIP: remove reducer and use form fields instead
* Show defaults when using override in route settings
* Update alert rule model for simplified routing
* Use defaults in placeholders when overriding timings
* Add validation for contact point
* Add selected contact point details
* Refactor: extract components to separate files and reorg in subfolders
* Fix test
* Update revalidate mode in form
* Extract RuleEditorSectionBody outside NotificationStep component to avoid unmounting any time this one renders
* Remove reValidateMode option in form
* Fix after merging
* Address PR review comments part1
* Address PR review comments part2
* Create routeTimingsFields constant to reuse labels, descriptions and arial labels for the mute timing fields
* Move conditional rendering to the parent in AutomaticRooting and ManualAndAutomaticRouting
* Simplify AlertManagerManualRouting properties
* (WIP) Alerting: Use the forked Alertmanager for remote secondary mode
* fall back to using internal AM in case of error
* remove TODOs, clean up .ini file, add orgId as part of remote AM config struct
* log warnings and errors, fall back to remoteSecondary, fall back to internal AM only
* extract logic to decide remote Alertmanager mode to a separate function, switch on mode
* tests
* make linter happy
* remove func to decide remote Alertmanager mode
* refactor factory function and options
* add default case to switch statement
* remove ineffectual assignment
* pass `getLogRowContextQuery` to component
* reset `appliedContextFilters` in `getLogRowContextQuery`
* open show context in new tab
* open window before crafting url
* only open in new tab if getRowContextQuery is set
* only open `about:blank`
* change conditional
* Add definition of external service registration
* Add style and tables for permissions needed
* Add external service registration to local without counterpart
* Add feature toggle check
* Add feature flag check in the backend as well
* Add the disclaimer for permissions
---------
Co-authored-by: Gabriel MABILLE <gabriel.mabille@grafana.com>
* Use levenshtein method to sort metric names
* Optionally hide empty panels in MetricSelectScene
* Transform ignore leven
* Refactor code to use $behaviours. Move preview cache to class variable instead of state
* Use lazy loading for metric scene
* Update scenes lib
* simplify behavior
* Remove hide empty toggle
* Bump scenes
---------
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>