Skip to content

[ES|QL] Improve PROMQL command params map parsing#250633

Merged
vadimkibana merged 9 commits intoelastic:mainfrom
vadimkibana:promql-detailed-parsing-4
Jan 29, 2026
Merged

[ES|QL] Improve PROMQL command params map parsing#250633
vadimkibana merged 9 commits intoelastic:mainfrom
vadimkibana:promql-detailed-parsing-4

Conversation

@vadimkibana
Copy link
Copy Markdown
Contributor

@vadimkibana vadimkibana commented Jan 27, 2026

Summary

Improves PROMQL command parsing:

  • Mostly improves params map index pattern parsing. Now the parser properly breaks down index patterns into their constituent parts (cluster, index, selector) and wraps them in a new "bare" list AST node type.
  • Added support for a new 'bare' list subtype—lists without any enclosing brackets.
  • The pretty printers (BasicPrettyPrinter and WrappingPrettyPrinter) now know how to format these correctly, without adding extra brackets or weird indentation.
  • Also added a helper Builder.expression.list.bare() for constructing these nodes programmatically.

Checklist

@vadimkibana
Copy link
Copy Markdown
Contributor Author

/ci

@vadimkibana vadimkibana marked this pull request as ready for review January 28, 2026 15:33
@vadimkibana vadimkibana requested a review from a team as a code owner January 28, 2026 15:33
@vadimkibana vadimkibana added review release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Feature:ES|QL ES|QL related features in Kibana Team:ESQL ES|QL related features in Kibana t// v9.4.0 labels Jan 28, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-esql (Team:ESQL)

@vadimkibana vadimkibana enabled auto-merge (squash) January 28, 2026 15:38
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Jan 29, 2026

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #126 / "before all" hook in "{root}"
  • [job] [logs] Jest Tests #3 / PROMQL Validation param values invalid end date format
  • [job] [logs] Jest Tests #3 / PROMQL Validation param values invalid end date format
  • [job] [logs] Jest Tests #3 / PROMQL Validation param values invalid start date format
  • [job] [logs] Jest Tests #3 / PROMQL Validation param values invalid start date format
  • [job] [logs] Jest Tests #3 / PROMQL Validation param values invalid step format
  • [job] [logs] Jest Tests #3 / PROMQL Validation param values invalid step format
  • [job] [logs] Jest Tests #3 / PROMQL Validation param values valid ISO date for start
  • [job] [logs] Jest Tests #3 / PROMQL Validation param values valid ISO date for start
  • [job] [logs] Jest Tests #3 / PROMQL Validation query presence missing query
  • [job] [logs] Jest Tests #3 / PROMQL Validation query presence missing query
  • [job] [logs] Jest Tests #3 / PROMQL Validation query presence named query with parens
  • [job] [logs] Jest Tests #3 / PROMQL Validation query presence named query with parens
  • [job] [logs] Jest Tests #3 / PROMQL Validation required params missing end param
  • [job] [logs] Jest Tests #3 / PROMQL Validation required params missing end param
  • [job] [logs] Jest Tests #3 / PROMQL Validation required params missing start param
  • [job] [logs] Jest Tests #3 / PROMQL Validation required params missing start param
  • [job] [logs] Jest Tests #3 / PROMQL Validation required params missing step param
  • [job] [logs] Jest Tests #3 / PROMQL Validation required params missing step param
  • [job] [logs] Jest Tests #3 / PROMQL Validation required params no errors with all required params
  • [job] [logs] Jest Tests #3 / PROMQL Validation required params no errors with all required params

Metrics [docs]

Page load bundle

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

id before after diff
kbnUiSharedDeps-srcJs 4.5MB 4.5MB +1.9KB

History

Copy link
Copy Markdown
Contributor

@bartoval bartoval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR will make my life easier in validate, Thanks!

I added a couple of commits to align (i will optimize this part later) my part and fix the failing tests

@vadimkibana vadimkibana merged commit a16542a into elastic:main Jan 29, 2026
16 checks passed
hannahbrooks pushed a commit to hannahbrooks/kibana that referenced this pull request Jan 30, 2026
## Summary

Improves `PROMQL` command parsing:

- Mostly improves params map index pattern parsing. Now the parser
properly breaks down index patterns into their constituent parts
(cluster, index, selector) and wraps them in a new "bare" list AST node
type.
- Added support for a new 'bare' list subtype—lists without any
enclosing brackets.
- The pretty printers (BasicPrettyPrinter and WrappingPrettyPrinter) now
know how to format these correctly, without adding extra brackets or
weird indentation.
- Also added a helper `Builder.expression.list.bare()` for constructing
these nodes programmatically.


### Checklist


- [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
bartoval added a commit that referenced this pull request Feb 2, 2026
## Summary

With this #250633 we get better
support from AST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:ES|QL ES|QL related features in Kibana release_note:skip Skip the PR/issue when compiling release notes review Team:ESQL ES|QL related features in Kibana t// v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants