kibana icon indicating copy to clipboard operation
kibana copied to clipboard

[Console] Add ESQL autocomplete support

Open ElenaStoeva opened this issue 8 months ago • 6 comments

Closes https://github.com/elastic/kibana/issues/208450

Summary

This PR adds ESQL autocomplete support to Console. The ESQL suggestions are only displayed inside triple-quotes queries ("query": """...).

How to test:

  1. Open Kibana and load some data (e.g. the sample data sets).
  2. Navigate to Dev Tools -> Console and type in the following query:
POST _query
{
    "query": """ """
}
  1. Verify that ESQL suggestions are displayed inside the triple quotes and work as in the ESQL editor in Discover. Example ESQL query: FROM kibana_sample_data_ecommerce | WHERE order_date >= ?_tstart AND order_date <= ?_tend | LIMIT 10

  2. Verify that no ESQL suggestions are displayed outside triple-quotes queries

  3. Verify that no Console suggestions are displayed inside triple-quotes queries

  4. Verify that the functionality also works in embeddable Console.

https://github.com/user-attachments/assets/63f1b82d-50a2-4af4-b5ad-812eab9a55a5

Release notes

These changes add autocompletion for ESQL query requests in Console.

ElenaStoeva avatar May 02 '25 16:05 ElenaStoeva

/ci

ElenaStoeva avatar May 07 '25 10:05 ElenaStoeva

Pinging @elastic/kibana-management (Team:Kibana Management)

elasticmachine avatar May 07 '25 13:05 elasticmachine

Thank you all for the feedback and sorry for the delayed response - I was OOO these past weeks. I addressed most of the comments and added follow-up questions/comments to the rest.

ElenaStoeva avatar May 30 '25 18:05 ElenaStoeva

@ElenaStoeva it would great also if you could check on this bundle increase. It is quite noticeable

image

stratoula avatar Jun 02 '25 13:06 stratoula

Thank you once again for reviewing @stratoula! I opened a few issue based on your feedback:

  • Discoverability issue: We discussed this with the team and decided for now to only enable the ESQL autocompletion inside triple quotes. To make it more visible, we will try adding a hint popup if the user types the query with a single quote - opened https://github.com/elastic/kibana/issues/223921 to track this work. @wajihaparvez will also help us add documentation to the ESQL docs page and/or the Console docs page - issue: https://github.com/elastic/kibana/issues/223923

  • Suggestions with params such as ?_tstart, _tend: opened https://github.com/elastic/kibana/issues/223926 to track this

  • Supporting suggestions that contain triple quotes: opened https://github.com/elastic/kibana/issues/223954

ElenaStoeva avatar Jun 13 '25 16:06 ElenaStoeva

:green_heart: Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
console 213 246 +33

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/monaco 187 191 +4
console 30 33 +3
total +7

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
console 186.2KB 192.9KB +6.7KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
console 0 1 +1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
console 27.5KB 27.8KB +287.0B
kbnUiSharedDeps-srcJs 3.7MB 3.7MB +681.0B
total +968.0B
Unknown metric groups

API count

id before after diff
@kbn/monaco 187 191 +4
console 39 42 +3
total +7

History

  • :broken_heart: Build #308804 failed bfca786889b9155773d6954cdea7d72a00744372
  • :green_heart: Build #307822 succeeded a415f3e48f8c1a41e68e378ffe7c2aaded9b43fa
  • :broken_heart: Build #307787 failed 5cd35424cbe5d87628930059565e4afae9fdef6e
  • :broken_heart: Build #307780 failed 2725171cf29e54641531b627a56f8ce203c8bbc1
  • :green_heart: Build #307488 succeeded fbfd5230aead464600f0149bf282d939d32ddbd8
  • :broken_heart: Build #307361 failed 9a11e642b1cad6e690c97e93c657e0c8f2c8ccf2

cc @ElenaStoeva

elasticmachine avatar Jun 16 '25 14:06 elasticmachine

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15729073535

kibanamachine avatar Jun 18 '25 09:06 kibanamachine

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- [Console] Fix autoselecting last request (#218001)

Manual backport

To create the backport manually run:

node scripts/backport --pr 219980

Questions ?

Please refer to the Backport tool documentation

kibanamachine avatar Jun 18 '25 09:06 kibanamachine

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15734765949

kibanamachine avatar Jun 18 '25 13:06 kibanamachine

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- [Console] Fix autoselecting last request (#218001)

Manual backport

To create the backport manually run:

node scripts/backport --pr 219980

Questions ?

Please refer to the Backport tool documentation

kibanamachine avatar Jun 18 '25 13:06 kibanamachine

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

ElenaStoeva avatar Jun 18 '25 14:06 ElenaStoeva

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. cc: @ElenaStoeva

kibanamachine avatar Jun 19 '25 14:06 kibanamachine