postgres_exporter/postgres_metrics_parse_script

16 lines
453 B
Bash
Executable File

#!/bin/bash
# Script to parse a text exposition format file into a unique list of metrics
# output by the exporter.
# Not currently used for CI, but useful for inspecting the differences of
# complicated PRs.
for raw_prom in $(echo .*.prom) ; do
# Strip, sort and deduplicate the label names
grep -v '#' "$raw_prom" | \
rev | cut -d' ' -f2- | \
rev | cut -d'{' -f1 | \
sort | \
uniq > "${raw_prom}.unique"
done