PromQL formatter?

1,796 views
Skip to first unread message

pin...@hioscar.com

unread,
Sep 14, 2020, 2:27:41 PM9/14/20
to Prometheus Users
What's a good formatter you guys recommend for formatting complex queries?

Ideally with line breaks and proper indentations after each ( or {.

Thanks!

Ben Kochie

unread,
Sep 14, 2020, 4:59:12 PM9/14/20
to pin...@hioscar.com, Prometheus Users

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/8b6cd4e4-24be-4066-9ee0-9d38850bbef3n%40googlegroups.com.

pin...@hioscar.com

unread,
Sep 15, 2020, 1:24:07 AM9/15/20
to Prometheus Users
Thanks. Before that's shipped, I'm hoping I can find a formatter that can do similar things, i.e. as simple as "adding line breaks and proper indentations after each ( or {."

pin...@hioscar.com

unread,
Mar 12, 2021, 12:49:02 PM3/12/21
to Prometheus Users
Anyone found a good formatter yet? Thanks

Shuxiong Xu

unread,
Aug 25, 2021, 5:33:49 AM8/25/21
to Prometheus Users
plz, Is there any update of this tools?

Zhu Xiangbin

unread,
Dec 27, 2021, 8:23:27 AM12/27/21
to Prometheus Users
Is there any update of this tool?
Message has been deleted

Facetoe

unread,
Jul 2, 2022, 5:05:57 AM7/2/22
to Prometheus Users
I wrote a formatter for PromQL people might find useful - https://github.com/facetoe/promformat

Sam Jewell

unread,
Nov 24, 2023, 7:05:13 AM11/24/23
to Prometheus Users
I used ChatGPT today, and found it gave a SUPER neat formatting to my code.

Thanks Facetoe for https://github.com/facetoe/promformat - I tried that too, and I like it. But actually I found the ChatGPT formatting to be even more readable (40 lines instead of 110 lines)

Cheers, Sam

Brian Candler

unread,
Nov 24, 2023, 8:12:00 AM11/24/23
to Prometheus Users
Yes, but what guarantee do you have that the ChatGPT output is actually equivalent to your original input? ChatGPT is famous for making stuff up.
Reply all
Reply to author
Forward
0 new messages