#!/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
    cat $raw_prom | grep -v '#' | \
        rev | cut -d' ' -f2- | \
        rev | cut -d'{' -f1 | \
        sort | \
        uniq > ${raw_prom}.unique
    
done