Parse before comparing labels
Check the whole PromQL expression first. A missing brace or parenthesis is reported at a line and column; an invalid query never becomes downloadable formatted output.
Logs and observability
Paste an expression for local parsing, or switch to sample matching and RE2 testing. The page does not execute time-series queries.
Processed in this browser; no Prometheus connection or query upload.
Enter an expression or load an example.
A dashboard can show no data for many reasons. PromQL formatter helps separate a malformed expression from a selector that simply misses the label values you expected.
Keep the original query visible while checking its structure. The formatter changes spacing only at recognized PromQL boundaries, so you can compare its output with the input before using it elsewhere.
Three related checks, with a clear boundary between syntax and actual data.
PromQL formatter applies a pure vector selector to pasted metric lines and reports each match. A status=~"5.." filter can be tried against 500, 200, and 503 without claiming to fetch live series.
An anchored RE2 engine tests label values rather than a JavaScript regex approximation. PromQL formatter rejects unsupported lookarounds instead of quietly giving you a misleading match.
Use the example to learn which result is a parse, a sample match, or a regex match.
Check the whole PromQL expression first. A missing brace or parenthesis is reported at a line and column; an invalid query never becomes downloadable formatted output.
The sample mode accepts a metric selector such as http_requests_total{job="api"}. Paste one metric and its labels per line; optional numeric sample values are ignored.
In RE2 mode, enter a matcher pattern and one value per line. A pattern 5.. matches 500 but not 1500 because Prometheus label regexes match the whole value.
The modes answer different questions about a query's text and labels.
The PromQL validator parses the query and shows a conservative formatted version plus a syntax tree. Errors stop export and point to the offending line.
The PromQL label matcher evaluates =, !=, =~ and !~ together against each local sample, including the empty-string behavior of absent labels.
PromQL regex uses RE2, so backreferences and lookaround are rejected. A full-string result is shown for each value you supply.
These rules prevent a text check from being mistaken for a live query result.
Short answers about formatting, grouping, labels, and regex behavior.
Yes. PromQL formatter parses and formats the text in this browser tab. It does not contact a Prometheus instance, so the result cannot confirm that the referenced metrics exist.
It adjusts spacing at syntax-tree boundaries and shows a structure view. It keeps the original input; formatting is not an automatic repair for an invalid expression.
Prometheus uses RE2 with a full-string match. In the sample and regex modes, 5.. matches 500, but a substring inside 1500 is not a match.
The PromQL parser can inspect a sum by expression. The sample matcher only filters metric labels with a pure vector selector; it cannot calculate aggregated values.
Choose the selector mode, paste a vector selector and one metric sample per line, then inspect which labels failed on each nonmatching row.
Found a PromQL edge case we missed?
PromQL formatter gives a syntax view, local selector examples, and a real RE2 check before the expression reaches an alert or dashboard.
Copy only a current, valid result; changing input immediately disables export until the new check finishes.