New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PromQL format and label matcher set/delete commands to promtool #11411
Add PromQL format and label matcher set/delete commands to promtool #11411
Conversation
Example usage: $ ./promtool promql format 'foo{bar="baz"}'
foo{bar="baz"}
$ ./promtool promql format 'foo{bar="baz"}/bar'
foo{bar="baz"} / bar
$ ./promtool promql label-matchers set 'foo{bar="baz"}/bar' 'qux' 'qaz'
foo{bar="baz",qux="qaz"} / bar{qux="qaz"}
$ ./promtool promql label-matchers delete 'foo{bar="baz"}/bar' 'bar'
foo / bar |
Realized I should have brought this up directly w/ Prometheus team first, have opened the discussion here: |
Sounds like there is consensus on the mailing list |
be50301
to
4814ef5
Compare
Signed-off-by: Rob Skillington <rob@chronosphere.io> Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
4814ef5
to
b3b669f
Compare
I have rebased this and added a |
docs/command-line/promtool.md
Outdated
|
||
### `promtool promql` | ||
|
||
PromQL formatting and editing. Requires the --experimental flag. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PromQL formatting and editing. Requires the --experimental flag. | |
PromQL formatting and editing. Requires the `--experimental` flag. |
👍 otherwise |
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
d908b5a
to
fd5b01a
Compare
This builds on #10544 which
intended later would be added the ability to format PromQL queries to
promtool
to allow formatting of PromQL queries and also setting/deleting label matchers
contained by a PromQL query (useful for programmatic manipulation of query
definitions).