324 Commits

Author SHA1 Message Date
4738957360 Querying: Pass dashboard and panel title as headers (#107032)
* WIP dashboard titile

* Add tests

* Fix tests

* Fix tests

* Remove redundant imports
2025-06-25 13:51:23 +02:00
8b4b77c928 QueryLibrary: Analytics (#106740)
Query Library Analytic Changes
2025-06-18 09:54:52 -04:00
2b8c74de2e i18n: removes useTranslate hook (#106556)
* i18n: removes useTranslate hook

* chore: fix duplicate imports

* chore: fix import sorting and hook dependencies
2025-06-12 11:03:52 +02:00
8b262046e0 legacy annotation query - handle undefined scenarios without crashing (#106275)
legacy annotation query - handle undefined scenario
2025-06-03 08:33:36 -04:00
abb885c585 I18n: Move eslint rule to package (#105860) 2025-05-29 16:11:59 +02:00
ea0e49a6e6 Chore: Restrict imports of test files to avoid test pollution (#106057) 2025-05-28 10:37:15 +02:00
119d5897ea i18n: imports use @grafana/i18n (#105177)
* i18n: everything should target @grafana/i18n

* wip

* chore: updates after PR feedback

* Trigger build

* Trigger build

* Trigger build

* chore: skip flaky tests

* chore: skip flaky tests

* chore: skip flaky tests

* chore: skip flaky tests

* chore: skip flaky tests

* chore: skip flaky tests

* chore: revert all flaky tests

* chore: some incorrect usages of useTranslate
2025-05-15 09:17:14 +02:00
a1b294e39f i18n: Fix incorrect interpolation in query group options (#104873) 2025-05-02 16:20:16 +01:00
9ed3c9ee8a Internationalisation: Final mark up of strings (#104165)
* some more markup

* more markup

* more markup

* almost there...

* more markup

* more markup

* last markup!

* fix unit tests
2025-04-22 11:02:01 +01:00
0a8dccc19a Alerting: New alert list filter improvements (#103107)
* Move filtering code to generators for performance reasons

Discarding rules and groups early in the iterable chain limits the number of promises we need to wait for which improves performance significantly

* Add error handling for generators

* Add support for data source filter for GMA rules

* search WIP fix

* Fix datasource filter

* Move filtering back to filtered rules hook, use paged groups for improved performance

* Add queriedDatasources field to grafana managed rules and update filtering logic to rely on it

- Introduced a new field `queriedDatasources` in the AlertingRule struct to track data sources used in rules.
- Updated the Prometheus API to populate `queriedDatasources` when creating alerting rules.
- Modified filtering logic in the ruleFilter function to utilize the new `queriedDatasources` field for improved data source matching.
- Adjusted related tests to reflect changes in rule structure and filtering behavior.

* Add FilterView performance logging

* Improve GMA Prometheus types, rename queried datasources property

* Use custom generator helpers for flattening and filtering rule groups

* Fix lint errors, add missing translations

* Revert test condition

* Refactor api prom changes

* Fix lint errors

* Update backend tests

* Refactor rule list components to improve error handling and data source management

- Enhanced error handling in FilterViewResults by logging errors before returning an empty iterable.
- Simplified conditional rendering in GrafanaRuleLoader for better readability.
- Updated data source handling in PaginatedDataSourceLoader and PaginatedGrafanaLoader to use new individual rule group generator.
- Renamed toPageless function to toIndividualRuleGroups for clarity in prometheusGroupsGenerator.
- Improved filtering logic in useFilteredRulesIterator to utilize a dedicated function for data source type validation.
- Added isRulesDataSourceType utility function for better data source type checks.
- Removed commented-out code in PromRuleDTOBase for cleaner interface definition.

* Fix abort controller on FilterView

* Improve generators filtering

* fix abort controller

* refactor cancelSearch

* make states exclusive

* Load full page in one loadResultPage call

* Update tests, update translations

* Refactor filter status into separate component

* hoist hook

* Use the new function for supported rules source type

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2025-04-11 10:02:34 +02:00
8df9c57045 Internationalisation: More markup for translations (#103726)
* mark up variables/trails/transformers

* more markup

* fix unit tests

* final unit test fix
2025-04-10 13:52:46 +01:00
1bbe970e59 QueryLibrary: Add From Library Icon Action (#103317)
* QueryLibrary: AddfromIcon init work

* Removed console log

* updated i18n

* Added unit tests for button

* Fixed linting

* Updates per feedback - new replace method

* Remove run query call when replace

* lint fixes

* Feedback + method renaming to 'replace'

* Fix await
2025-04-08 09:52:07 -04:00
641031cfaf Chore: Type fixes (#103340)
* tidy tidy

* more fixes

* some TableNG fixes

* another TableNG test fix

* some more fixes

* betterer...
2025-04-07 11:29:30 +01:00
8eea0c9a3d Explore: Use fixed dates to prevent DST issues in tests (#103497)
* Explore: Use fixed dates to prevent DST issues in tests

* PanelQueryRunner: Use fixed dates to prevent DST issues in tests
2025-04-06 17:04:28 +02:00
f96e4e9ad2 Frontend: Remove Angular (#99760)
* chore(angularsupport): delete feature toggle to disable angular

* feat(angular-support): remove config.angularSupportEnabled

* chore(jest): remove angular from setup file

* chore(angular): delete angular deprecation ui components

* refactor(angular): move migration featureflags into migration notice

* chore(dashboard): remove angular deprecation notices

* chore(annotations): remove angular editor loader

* feat(appwrapper): no more angular app loading

* feat(pluginscatalog): clean up angular plugin warnings and logic

* chore(angular): delete angular app and associated files

* feat(plugins): delete old angular graph plugin

* feat(plugins): delete old angular table panel

* feat(frontend): remove unused appEvent type

* feat(dashboards): clean up angular from panel options and menu

* feat(plugins): remove graph and table-old from built in plugins and delete sdk

* feat(frontend): remove angular related imports in routes and explore graph

* feat(theme): remove angular panel styles from global styles

* chore(i18n): run make i18n-extract

* test(api_plugins_test): refresh snapshot due to deleting old graph and table plugins

* chore(angulardeprecation): delete angular migration notice components and usage

* test(frontend): clean up tests that assert rendering angular deprecation notices

* chore(backend): remove autoMigrateOldPanels feature flag

* chore(config): remove angularSupportEnabled from config preventing loading angular plugins

* chore(graphpanel): remove autoMigrateGraphPanel from feature toggles

* chore(tablepanel): delete autoMigrateTablePanel feature flag

* chore(piechart): delete autoMigratePiechartPanel feature flag

* chore(worldmappanel): remove autoMigrateWorldmapPanel feature toggle

* chore(statpanel): remove autoMigrateStatPanel feature flag

* feat(dashboards): remove automigrate feature flags and always auto migrate angular panels

* test(pluginsintegration): fix failing loader test

* test(frontend): wip: fix failures and skip erroring migration tests

* chore(codeowners): remove deleted angular related files and directories

* test(graphite): remove angular mock from test file

* test(dashboards): skip failing exporter test, remove angularSupportEnabled flags

* test(dashbaord): skip another failing panel menu test

* Tests: fixes pkg/services/pluginsintegration/loader/loader_test.go (#100505)

* Tests: fixes pkg/services/pluginsintegration/plugins_integration_test.go

* Trigger Build

* chore(dashboards): remove angularComponent from getPanelMenu, update test

* feat(dashboards): remove all usage of AngularComponent and getAngularLoader

* chore(betterer): refresh results file

* feat(plugins): remove PluginAngularBadge component and usage

* feat(datasource_srv): remove usage of getLegacyAngularInjector

* feat(queryeditor): delete AngularQueryComponentScope type

* Chore: removes Angular from plugin_loader

* Chore: remove angular from getPlugin

* Chore: fix i18n

* Trigger Build

* Chore: remove more Angular from importPanelPlugin

* Chore: remove search options warning

* Chore: remove and deprecate Angular related

* chore(angular): remove angular dependencies from core and runtime

* chore(runtime): delete angular injector

* chore(data): delete angular scope from event bus

* chore(plugin-catalog): remove code pushing app plugins angular config page

* chore(yarn): refresh lock file

* chore(frontend): remove ng-loader from webpack configs, remove systemjs cjs plugin

* chore(navigation): remove tether-drop cleanup from GrafanaRouter, delete dependency

* chore(runtime): delete AngularLoader

* chore(betterer): refresh results file

* chore(betterer): fix out of sync results file

* feat(query): fix type and import errors in QueryEditorRow

* test(dashboards): delete skipped angular related tests

* Tests: add back tests and fix betterer

* Tests: fix broken test

* Trigger build

* chore(i18n): remove angular deprecation related strings

* test: clean up connections and plugins catalog tests

* chore(betterer): update results file

---------

Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
2025-04-04 11:31:35 +02:00
dc5badd9b2 Internationalisation: More automatic markup (#102792)
* more automatic i18n markup

* better labels

* little bit of tidy up

* fix unit tests
2025-03-27 10:12:25 +00:00
6822805c32 Grafana Runtime: Use package.json exports for internal code (#102100)
* refactor(frontend): update runtime import paths for grafana/runtime/src -> grafana/runtime

* feat(runtime): introduce internal api entrypoint and exports property

* refactor(frontend): update runtime imports to use internal entrypoint

* chore(betterer): update results file

* refactor(bookmarks): update runtime/unstable import

* chore(betterer): update results file

* test(frontend): fix failing tests due to mocking nested runtime imports

* test(datasourcesrv): fix failing tests due to mocks

* chore(alerting): clean up redundant import

* fix(packages): fix default require export pointing to types declaration file

* docs(packages): update readme related to exports

* chore(internationalization): fix import paths

* chore(betterer): update results file
2025-03-27 08:59:57 +01:00
a1a3aa0665 Feat: Make expressions work with plugins that set alerting:false but backend:true in their plugin.json files (#102232)
* Making expressions depend on backend parameter instead of alerting

* Fallback to old behavior just in case we have weird edge cases

* adding render test for the button

* prettier fixes
2025-03-20 10:49:10 +01:00
7f9fa8c662 Grafana UI: Clearly separate multiple warnings by using HTML tags (#97979)
* Allow html in tooltips

* Display multiple warnings/infos properly with html

* Revert "Allow html in tooltips"

This reverts commit 5c7e965d2d554b693d4897e52cf6865e0c9b8374.

* Display multiple warnings/infos properly with html in ReactNode

* Fix lint

* Revise according to code review

* Revise according to code review part 2

* Revise according to code review part 3
2025-03-19 07:05:53 +01:00
e948376a95 feat: component extension point for adaptive telemetry query actions (#101331)
* feat: component extension point for adaptive telemetry query actions

- only render the first non-null added-component, and provide utility in the added component infrastructure to  support this

---------

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2025-03-18 12:45:01 -04:00
da8f26a07c Alerting: Refactor and clean up rule type guard functions (#101639) 2025-03-07 16:15:55 +01:00
9406830a94 Alerting: Fix passing time range to query components (#101041)
Add range prop to QueryEditorRow, pass range from QueryWrapper
2025-02-26 11:07:06 +01:00
4b9fee61a8 QueryLibrary: Move to enterprise (#100133) 2025-02-07 11:09:51 +01:00
86a68627dd QueryLibrary: Make query library available outside of Explore (#99319) 2025-01-30 14:53:01 +01:00
d8d84a000a Dashboards: Allow DashboardDS subqueries in MixedDS (#97116)
* Allow dashboardDS to run in mixedDS

* Make mixedDS panel wait for dashboardDS panel to load first

* cleanup

* cleanup

* refresh dashboardDS queries within mixedDS when source panel changes

* more tests

* fix

* fixes scenario where source returns an error

* do not allow dashboardDS references to mixedDS targets that contain other dashboardDS panels

* test

* lint

* Show invalid panels as invalid and with a message

* refactor

* avoid bunching shared dashboard queries

* skip instead of debouncing to avoid stale data

* debouce dashboard ds result stream when coming from mixed ds

* restore unnecessarily touched files

* fix import

* increase debounce interval value to account for slower machines

---------

Co-authored-by: Sergej-Vlasov <sergej.s.vlasov@gmail.com>
2025-01-13 15:01:34 +02:00
22282334c7 Prometheus datasource: Update info annotations without missing severity level (#98485)
Update how info severity level is handled along with changes in plugin-sdk-go
2025-01-09 08:24:56 +01:00
739b7716b1 Usage Insights: Fix usage insight errors being logged as [object Object] (#93502)
* join error strings instead of raw errors

* add unit test
2025-01-06 16:25:05 -05:00
e3e51f6e3b Prometheus datasource: Show info annotations in the UI (#97978)
* Show info annotations from Prometheus datasources in the UI

* Add test data for backend
2025-01-03 20:09:19 +01:00
b88ce9df38 Chore: Remove Dashboard datasource barrel file (#98040)
* chore(dsahboard-datasource): delete barrel file

* refactor(dashboards): update paths for dashboard ds imports

* chore(betterer): update file

* style(dashboard-datasource): fix linting errors
2024-12-18 13:18:55 +01:00
3af96acc12 UsageInsights: Include panelId and panelName in events when available 2024-12-16 12:57:23 +01:00
1fc9b4bfc1 Chore: Remove dashboard state barrel file (#97562)
* refactor(dashboard-state): delete dashboard/state barrel file and update imports

* chore(betterer): update results
2024-12-06 16:01:51 +01:00
ac04abb7a4 Revert "PanelQueryRunner: Use rxjs merge, not lodash merge (#96881)" (#96999)
This reverts commit a8b6c81d12648c0bf44ab38c0c0be6847c567e6b.
2024-11-25 18:12:37 +00:00
a8b6c81d12 PanelQueryRunner: Use rxjs merge, not lodash merge (#96881) 2024-11-25 09:24:58 -06:00
192423956b GrafanaUI: Mark ScrollContainer as stable and deprecate CustomScrollbar (#96331)
* deprecate CustomScrollbar, promote ScrollContainer

* add documentation start

* use the properly exported ScrollContainer

* Update packages/grafana-ui/src/components/ScrollContainer/ScrollContainer.mdx

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>

---------

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
2024-11-14 12:06:21 +00:00
1e001451bd ScrollContainer: Replace CustomScrollbar usage (#96229)
* replace CustomScrollbar

* use ScrollContainer in RolePickerMenu and PanelDataPane
2024-11-12 15:43:04 +00:00
ea0a6a1f7f Alerting: Force refetch prom rules when refreshing panel (#96120)
Force refetch prom rules when refreshing panel
2024-11-08 17:07:43 +02:00
94bbc081c8 Chore: Finish converting emotion styles to object syntax (#95399)
* convert some emotion styles to object syntax

* convert more styles to object syntax

* fix placeholder content
2024-10-25 14:50:28 +01:00
22a3c9976f Chore: Convert QueryGroupOptions to functional component (#94342)
Also rewrites styles
2024-10-15 12:57:58 +01:00
235f7db967 Add query migration handlers (#93735) 2024-10-14 09:29:44 +02:00
636d17c111 PanelQueryRunner: Fix diff between multiple errors (#89868) 2024-10-10 11:02:33 +02:00
e80ef522bb Alerting: Hide query name when using simplified mode in the alert rule (#93779)
* Hide query name when using simplified mode in the alert rule

* rename hideName to hideRefId
2024-10-02 13:55:48 +02:00
536edee7bf Alerting: Query and expressions section simplification (#93022)
* Add mode switch in Query section

* Implement simple query mode : WIP

* fix logic switching mode

* move guard and get methodd to another folder

* Add more requiremts for being transformable from advanced to not advanced mode

* fix usig mode when it's not a grafana managed alert

* Show warning when switching to not advanced and its not possible to convert

* Add feature toggle alertingQueryAndExpressionsStepMode

* fix test

* add translations

* address PR feedback

* Use form context for sharing simplfied mode used, save in local storage and use the new fields in the api

* add check to valid reducer and threshold when switching to simplified mode

* Use only one expression list

* fix test

* move existing rule check outside storeInLocalStorageValues

* add id in InlineSwitch to handle onClick on label

* fix

* Fix default values when editing existing rule

* Update dto fields for the api request

* fix snapshot

* Fix recording rules to not show switch mode

* remove unnecessary Boolean conversion

* fix areQueriesTransformableToSimpleCondition

* update text

* pr review nit

* pr review part2
2024-09-26 08:33:14 +02:00
ab312914cd Chore: cleanup util SCSS styles (#92078)
migrate SCSS util classes
2024-08-20 09:31:04 +01:00
783ff71560 Explore: Allow saving to Query Library from query row (#89381)
* wip

* Add save functionality to query row

* add success conditional

* move around translations

* Add translations

* Add key to fix test

* Add key to the right spot

* define specific save button

* WIP - Use RowActionComponents to add action without modifying the core component

* Only add component once on render

* Move logic to main explore page

* Add keyed render actions to prevent redundancy, use this to add keyed action

* Overcome the forces of dayquil to attempt to make actual sense

* Add scoped actions to query action component

* Spaces not allowed in generateName
2024-07-30 13:56:44 -05:00
b321dc7280 Chore: Migrate from react-beautiful-dnd to @hello-pangea/dnd (#90328)
* migrate from react-beautiful-dnd to @hello-pangea/dnd

* revert comment
2024-07-12 10:23:29 +01:00
2b7338f8b6 Add optional APIVersion to DatasourceRef (#90076) 2024-07-08 13:12:56 +02:00
47f8717149 React: Use new JSX transform (#88802)
* update eslint, tsconfig + esbuild to handle new jsx transform

* remove thing that breaks the new jsx transform

* remove react imports

* adjust grafana-icons build

* is this the correct syntax?

* try this

* well this was much easier than expected...

* change grafana-plugin-configs webpack config

* fixes

* fix lockfile

* fix 2 more violations

* use path.resolve instead of require.resolve

* remove react import

* fix react imports

* more fixes

* remove React import

* remove import React from docs

* remove another react import
2024-06-25 12:43:47 +01:00
396e75dadf Chore: Type improvements (#87634)
* improve typings in opentsdb datasource

* couple of influx improvements

* couple more

* more

* more more more

* 3 more

* changes to variables/inspect/utils

* some graphite improvements
2024-05-10 17:28:44 +01:00
cbe868b118 Chore: Use getNextRefId instead of deprecated getNextRefIdChar (#87460) 2024-05-10 12:00:17 +01:00
4b720206d4 Alerting: Reduce number of request fetching rules in the dashboard view using rtkq (#86991)
* Reduce number of request fetching rules in the dashboard view using rtkq

* Fix UnifiedAlertStatesWorker work

* refactor ungroupRulesByFileName

* Address review comments and fix test

* fix DashboardQueryRunner test

* Fix tests

* Update AlertStatesDataLayer to use RTKQ

* Fix PanelAlertTabContent test

* Fix PanelAlertTabContent test after adding RTKQ

* fix test and address PR review comments

* Update useCombinedRuleNamespaces to have both dashboardUID and panelId as optional params and rename the hook

* Address review pr comment

* remove test about template variables

* Use poll interval in useCombinedRules
2024-05-10 12:27:06 +02:00