1
0
Fork 0
Commit Graph

2 Commits (master)

Author SHA1 Message Date
Mike Gerwitz d511fa8d17
prom.awk: Correct regex escape
I'm not confident this ever worked as intended.  Unless behavior in
newer Gawks changed (since now it is issuing a warning where it wasn't
previously).

This replaced double quotes with '0'..which certainly solves the
security problem of double quotes, but not in the intended way.  I have
no labels with double quotes and so never noticed.

I suspect that I tried using // delimiters to avoid having to go through
this escape mess ("\\\\" to produce "\\" which is recogniezd as a single
"\" in the replacement, and then a fifth to escape the double quote.
What a mess.
2023-12-31 16:33:21 -05:00
Mike Gerwitz 9c7961bb5c
prom.awk: New basic library
This introduces the beginning of a very basic library for generating
Prometheus metrics with GNU Awk.  It is not intended to be complete, and
it'll evolve as I need it to.

At the moment, there are no tests, because manual verification is
trivial and I'm not yet sure how far I'll be going with this.  If it
evolves much further, though, I'll be adding a test suite.
2021-03-01 21:56:30 -05:00