monero-exporter/hack/table-printer.awk
Ciro S. Costa 31f5a6f84b port over code from monero-operator
the code has been initially written under `monero-operator`, but it
turns out that having the exporter available for non-kubernetes users is
pretty good, thus, making it its own separate thing.

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-06-26 10:54:14 -04:00

24 lines
504 B
Awk
Executable File

#!/usr/bin/awk -f
# gh-table-printer - prints to `stdout` the metric descriptions
# in GitHub flavored markdown tables[1].
#
# [1] - https://help.github.com/articles/organizing-information-with-tables/
#
# Usage: `curl -s localhost:9100/metrics | grep container_ | ./gh-table-printer`
BEGIN {
print "| name | description |"
print "| ---- | ----------- |"
}
/HELP/ {
line="| " $3 " |"
for (i = 4; i <= NF; i++) {
line = line " "$i
}
line = line " |"
print line
}