Make your PromQL or MetricsQL beautiful.
https://laixintao.github.io/promql-metricsql-prettify/
Installation:
go install github.com/laixintao/promql-metricsql-prettify@latest
Usage: pass your PromQL or MetricsQL into promql-metricsql-prettify
as stdin:
$ echo 'count(sum(label_replace(node_uname_info, "kernel", "$1", "release", "([0-9]+.[0-9]+.[0-9]+).*")) by (kernel)) > 1' | promql-metricsql-prettify
count(
sum(
label_replace(
node_uname_info,
"kernel",
"$1",
"release",
"([0-9]+.[0-9]+.[0-9]+).*"
)
) by(kernel)
)
>
1
xbin.io is a collection of cli tools, you can send your input via HTTP Request (cURL) to xbin.io, and xbin.io will run the command, then return output via HTTP Response. (You can think it as... serverless shell?)
Use this tool on: https://xbin.io/w/tool/promql-metricsql-prettify
Use it through cURL from terminal:
$ echo 'count(sum(label_replace(node_uname_info, "kernel", "$1", "release", "([0-9]+.[0-9]+.[0-9]+).*")) by (kernel)) > 1' | \
curl -X POST --data-binary @- https://xbin.io/promql-metricsql-prettify
count(
sum(
label_replace(
node_uname_info,
"kernel",
"$1",
"release",
"([0-9]+.[0-9]+.[0-9]+).*"
)
) by(kernel)
)
>
1
How does it work?
|
pip will send your PromQL into curl- curl will send the conent to xbin.io/promql-metricsql-prettify
- xbin.io will run
promql-metricsql-prettify
- You get the result from cURL
- This project was inspired by https://github.com/jiacai2050/promql-prettier
- This project uses VictoriaMetrics's code,
prettier.go
in MetricsQL