feat: rework the --batch prometheus output entirely

This commit is contained in:
Stéphane Lesimple
2026-04-08 20:51:12 +02:00
parent 39dea1245e
commit 61fa02d577
4 changed files with 183 additions and 6 deletions

View File

@@ -116,7 +116,7 @@ while [ -n "${1:-}" ]; do
opt_no_color=1
shift
case "$1" in
text | short | nrpe | json | json-terse | prometheus)
text | short | nrpe | json | json-terse | prometheus | prometheus-legacy)
opt_batch_format="$1"
shift
;;
@@ -124,7 +124,7 @@ while [ -n "${1:-}" ]; do
'') ;; # allow nothing at all
*)
echo "$0: error: unknown batch format '$1'" >&2
echo "$0: error: --batch expects a format from: text, nrpe, json, json-terse" >&2
echo "$0: error: --batch expects a format from: text, short, nrpe, json, json-terse, prometheus, prometheus-legacy" >&2
exit 255
;;
esac