Documentation
¶
Overview ¶
Package promqlfmt formats PromQL queries.
Two backends are available:
- "vic": VictoriaMetrics metricsql.Prettify (the default)
- "main": a custom Prometheus-AST formatter with Grafana $variable support
Index ¶
Constants ¶
View Source
const ( BackendVic = "vic" BackendMain = "main" )
Backend names accepted by Format.
Variables ¶
This section is empty.
Functions ¶
func Format ¶
Format formats promql using the named backend. An empty or unrecognized backend falls back to BackendVic.
func FormatMain ¶
formatPromql takes a PromQL query string and returns a "prettified" version.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
promql-formatter
command
Command promql-formatter formats a PromQL query taken from a positional argument or from stdin, using the "vic" backend by default.
|
Command promql-formatter formats a PromQL query taken from a positional argument or from stdin, using the "vic" backend by default. |
Click to show internal directories.
Click to hide internal directories.