sdJobName:=sdCheckCmd.Arg("job","The job to run service discovery for.").Required().String()
@ -246,7 +248,7 @@ func main() {
"A list of one or more files containing recording rules to be backfilled. All recording rules listed in the files will be backfilled. Alerting rules are not evaluated.",
).Required().ExistingFiles()
promQLCmd:=app.Command("promql","PromQL formatting and editing.")
promQLCmd:=app.Command("promql","PromQL formatting and editing. Requires the --experimental flag.")
promQLFormatCmd:=promQLCmd.Command("format","Format PromQL query to pretty printed form.")
| <codeclass="text-nowrap">--enable-feature</code> | Comma separated feature names to enable (only PromQL related and no-default-scrape-port). See https://prometheus.io/docs/prometheus/latest/feature_flags/ for the options and more details. |
@ -30,6 +31,7 @@ Tooling for the Prometheus monitoring system.
| push | Push to a Prometheus server. |
| test | Unit testing. |
| tsdb | Run tsdb commands. |
| promql | PromQL formatting and editing. Requires the --experimental flag. |
@ -609,3 +611,72 @@ Create blocks of data for new recording rules.
| rule-files | A list of one or more files containing recording rules to be backfilled. All recording rules listed in the files will be backfilled. Alerting rules are not evaluated. | Yes |
### `promtool promql`
PromQL formatting and editing. Requires the --experimental flag.
##### `promtool promql format`
Format PromQL query to pretty printed form.
###### Arguments
| Argument | Description | Required |
| --- | --- | --- |
| query | PromQL query. | Yes |
##### `promtool promql label-matchers`
Edit label matchers contained within an existing PromQL query.
##### `promtool promql label-matchers set`
Set a label matcher in the query.
###### Flags
| Flag | Description | Default |
| --- | --- | --- |
| <codeclass="text-nowrap">-t</code>, <codeclass="text-nowrap">--type</code> | Type of the label matcher to set. | `=` |
###### Arguments
| Argument | Description | Required |
| --- | --- | --- |
| query | PromQL query. | Yes |
| name | Name of the label matcher to set. | Yes |
| value | Value of the label matcher to set. | Yes |