feat: Wrapping pretty-printer implementation for PromQL#47
Merged
Conversation
a1b22e4 to
dce44e8
Compare
stratoula
approved these changes
Mar 13, 2026
Contributor
stratoula
left a comment
There was a problem hiding this comment.
This is so nice Vadim! I really like the separation between the PromQL wrapping printer and its integration into the ES|QL wrapping printer. LGTM!
| "semantic-release:dry-run": "semantic-release --dry-run --debug", | ||
| "prepare": "husky" | ||
| "prepare": "husky", | ||
| "storybook": "storybook dev -p 6006", |
Contributor
There was a problem hiding this comment.
This is a typo right? You mean WithSilder
Collaborator
Author
There was a problem hiding this comment.
Yeah, should be WithSlider :)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Partially addresses: elastic/kibana#242923
This PR add pretty-printing for PromQL and integrates ES|QL and PromQL pretty printers so they work together to print an ES|QL query which might have
PROMQcommand with a nested PromQL subquery.Visual Examples
PromQL wrapping pretty printer in action:
Before
(note: PromQL query is not formatted, it uses
.text(visible ANTLR stream) property as returned by the parser):After
In this PR
src/embedded_languages/promql/pretty_print/VisitorAPI insrc/ast/visitor/to traverse PromQL query expressions. Use the new"visitPromqlExpression"to format PromQL sub-queries in basic and wrapping ES|QL pretty-printers..storybook/for visual testing. Run it withyarn storybook.src/stories/, some of them you can see in screen captures of above.Details
Technical details, breaking changes or considerations you have made while working in this PR.
Checklist
BREAKING CHANGE: changesyntax.breaking: true (!)majorfeatminorfixpatchrefactorpatchperfpatchbuildpatchdocspatchchorepatchrevertpatch