-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ES|QL] Dashboard variables (#202875)
## Summary Closes #203967 Supports dashboard variables in ES|QL charts. This PR introduces the first phase of ES|QL controls. In this phase: - the flow starts from Lens ES|QL editor (and no vice-versa, this will happen on a later phase after we discuss some technical details with ES) - it is only available for dashboards (we want to include them in other apps as Discover but this is the next phase driven by the presentation team) - it supports variables for intervals, fields and values. I haven't added support for functions. I am going to do it after this PR being merged (there are some business questions I want to answer first) For more info check this [deck](https://docs.google.com/presentation/d/1qSbWLSoC5SseXuLix763vpp8sa7ikp3pQTbHImEHBoc) ![meow](https://github.com/user-attachments/assets/c101a257-fbe4-44e6-9686-18012f39e8c1) ### Implementation details - There is a new service, the ESQLVariables service that is responsible for ES|QL variables. I isolated this to a new plugin owned by the ES|QL team for cleaner code and for avoiding circular dependencies - A new ESQL_CONTROL type got created. It follows the exact same logic as the rest controls. No changes in the architecture here. - The creation of the controls (the control forms) have been added in the esql plugin. - Lens has small changes: - The support of variables in the textBased datasource - Two callbacks needed to be called after the creation / cancellation of an ES|QL control ### Types of ES|QL variables We have 2 types: - Static Values (the user gives a list of values with his own responsibility). As the flow starts from the editor we can identify what they most possibly want to do and we give the user some options but they have the freedom to do as they want. A basic validation has been added too. - Values from an ES|QL query (the user gives an ES|QL query that generates the values). As the flow starts from the editor we can suggest a query for the users but they can always change it as they wish. <img width="1168" alt="image" src="https://github.com/user-attachments/assets/cc28beb8-111c-43ad-9f26-865bc62ae512" /> ### Example of a control creation from the editor ![meow](https://github.com/user-attachments/assets/09fa0e21-98cd-4160-b271-4f8ed0a91bf7) ### Release note ES|QL charts now allow the creation of controls in dashboards. You can control a part of the query such as a field, an interval or a value. ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Andrea Del Rio <[email protected]> Co-authored-by: Devon Thomson <[email protected]>
- Loading branch information
1 parent
bfddf6c
commit b84c65c
Showing
124 changed files
with
4,931 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.