Skip to content

[ES|QL] Supports PROMQL in the editor #246728

@stratoula

Description

@stratoula

Describe the feature:

Blocked by #243932

When we will finish with the support of promql at the AST we will be able to move on with supporting it at the editor. The PROMQL is a source command.

  • Highlighting should get updated
  • Client side validation
  • Autocomplete

We don't need to be very thorough as we are with the rest of ES|QL but we need to be sure that at least:

  • don't complain for things we should not
  • autocomplete to work decently (for example now if you use PROMQL it suggests FROM afterwards)

https://github.com/elastic/metrics-program/blob/main/docs/promql/esql-promql-syntax.md

This works like all source commands (meaning that the output can be the input for other processing commands


Milestone 0

  • PROMQL appears in command suggestions at query start
  • After typing PROMQL , parameter suggestions appear
  • After typing PROMQL index=, timeseries indices are suggested
  • After typing PROMQL step=, duration values are suggested (and so on..)
  • Parameters already used are not suggested again
  • Fix paths after queries (eg. suggest pipes in All forms that we can present a PROMQL query)
  • Add support for multi Index
  • Tests pass for all autocomplete scenarios
  • Column After
  • Local Validation for params

Requires PR to our external package:

  • Add PROMQL to tokenizer keyword list.

Milestone 1 - Basic Query Support

  • Add Promql Signatures support
  • Function names and aggregation (rate, sum, avg ....`)
  • Aggregation modifiers (by, without) (e.g sum(rate...) by(label ))
  • Metric and labels
  • operators ( ⚠️ Although we have implemented all operators, we only show the arithmetic ones for now. ES needs to end support for comparators and logic.)
  • Position detection inside (query) vs after
  • Show all timeseries metrics by default
  • Pass breackdown, metrics to the pipe
  • Local Validation for queries

Milestone 1.1 - Selectors & Labels

  • Group labels inside by(...)
  • Label suggestion ----> hidden until I complete the task below
  • Label matcher (=, !=, =~, !~) after label name
  • Range duration inside [] (5m, 1h, 1d) (we use a free placeholder)

Milestone 1.2 - Aggregations & Advanced

  • Alternative way to call aggregation modifiers (by, without) eg. like sum by(..) (...) ....) .
  • ⚠️ Without aggregator ---> (No supported yet by ES)
  • ⚠️ Binary modifiers (on, ignoring, group_left, group_right) ---> (No supported yet by ES)
  • ⚠️ offset ---> (No supported yet by ES)
  • ⚠️ @ modifier---> (No supported yet by ES)
  • ⚠️Subquery resolution ([5m:1m] ) ---> (Probably we don't need it)

Other (not urgent)

  • Handling comma for list of selectors
  • Documentation
  • Signature Popup
  • Hover

Post milestones

  • Add buckets parameter
  • Add scrape interval

Metadata

Metadata

Assignees

Labels

Feature:ES|QLES|QL related features in KibanaTeam:ESQLES|QL related features in Kibana t//blocked

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions