diff --git a/postgres_metrics_added_and_removed b/postgres_metrics_added_and_removed new file mode 100755 index 00000000..d3361890 --- /dev/null +++ b/postgres_metrics_added_and_removed @@ -0,0 +1,11 @@ +#!/bin/bash +# Script to determine added and removed metrics. +# Not currently used in CI but useful for inspecting complicated changes. + +type=$1 +version=$2 +old_version=$3 +new_version=$4 + +comm -23 $old_version $new_version > .metrics.${type}.${version}.removed +comm -13 $old_version $new_version > .metrics.${type}.${version}.added diff --git a/postgres_metrics_parse_script b/postgres_metrics_parse_script new file mode 100755 index 00000000..393e39a1 --- /dev/null +++ b/postgres_metrics_parse_script @@ -0,0 +1,16 @@ +#!/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