File: postgres_metrics_parse_script

package info (click to toggle)
prometheus-postgres-exporter 0.4.7%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 352 kB
  • sloc: sh: 380; makefile: 100
file content (16 lines) | stat: -rwxr-xr-x 460 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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