[ANN] PromQL Prettier

162 views
Skip to first unread message

Jiacai Liu

unread,
Sep 18, 2021, 11:42:31 AM9/18/21
to promethe...@googlegroups.com

Have trouble in reading PromQL written by your colleagues or SRE
team?

promql-prettier to the rescue!

- https://github.com/jiacai2050/promql-prettier

Any issues or feedbacks are welcomed.

Thanks.

Evelyn Pereira Souza

unread,
Sep 18, 2021, 1:36:19 PM9/18/21
to promethe...@googlegroups.com
Hi

Very nice! Thanks

I would send out the mails also to
https://www.mail-archive.com/prometheu...@googlegroups.com/

kind regards
Evelyn

OpenPGP_0x61776FA8E38403FB.asc
OpenPGP_signature

Bjoern Rabenstein

unread,
Sep 28, 2021, 1:47:52 PM9/28/21
to Jiacai Liu, promethe...@googlegroups.com
That looks pretty neat. I'll try it out.

Did you collaborate with Harkishen Singh, whose GSoC project was
tackling the same problem and who wrote the design doc? Or did you all
of this from scratch?

Any reason why you used the MetricsQL parser rather than the PromQL
parser? Both languages are slightly different, and new features in
PromQL won't necessarily make it to MetricsQL or might be delayed...

It would be cool to have this integrated in promtool as originally
planned. Another reason to use the Prometheus codebase...

--
Björn Rabenstein
[PGP-ID] 0x851C3DA17D748D03
[email] bjo...@rabenste.in

Bjoern Rabenstein

unread,
Oct 11, 2021, 11:48:48 AM10/11/21
to Jiacai Liu, promethe...@googlegroups.com
I haven't seen any reply to the above, but by now, I can provide a bit
more context:

There was already an effort to implement the original design
doc. Sadly, the PR became stale, but it would be cool to revive it,
see https://github.com/prometheus/prometheus/pull/7779 .

The problem with jiacai2050/promql-prettier is that it is actually not
a PromQL prettier but a MetricsQL prettier. Jiacai, if you do not have
plans to make it compliant with PromQL, you should consider renaming
it to avoid confusing your users. Note that PromQL is well defined. It
is also trademarked by the Linux Foundation. Check out
https://www.linuxfoundation.org/trademark-usage/ for implications.

Thanks for your understanding.

Jiacai Liu

unread,
Oct 12, 2021, 10:27:48 PM10/12/21
to Prometheus Users
Hi beorn7,
Sorry for delayed response. 
I choose MetricsQL as the parser for simplicity, as it require little dependencies.
it seems that PR 7779 is a non-trivial one, I have on idea if it's easy to merge my code to it although format logic is similar.

Maybe I need more time to dig into this. Could anyone guide me to finish 7779?

Bjoern Rabenstein

unread,
Oct 20, 2021, 8:48:21 AM10/20/21
to Jiacai Liu, Prometheus Users
On 12.10.21 19:27, Jiacai Liu wrote:
> it seems that PR 7779 is a non-trivial one, I have on idea if it's easy to
> merge my code to it although format logic is similar.
>
> Maybe I need more time to dig into this. Could anyone guide me to finish
> 7779?

Yeah, it would be great to have someone with context on PR #7779 in
particular and PromQL in general helping out.

I tried to rally some people, but only found out that neither Ganesh
nor Jessica are currently available.

Perhaps a good starting point would be to talk to Harkishen, who wrote
the design doc and authored the PR? He is @Harkishen-Singh on
GH. How about following up on the issue that you are interested in
helping out? If you and Harkishen could polish up the PR, I'm sure
we'll find a reviewer.

Thank you very much.
Reply all
Reply to author
Forward
0 new messages