File: checkmetrics.sh

package info (click to toggle)
prometheus-node-exporter 1.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,692 kB
  • sloc: sh: 800; makefile: 175; ansic: 122
file content (16 lines) | stat: -rwxr-xr-x 444 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env bash

if [[ ( -z "$1" ) || ( -z "$2" ) ]]; then
    echo "usage: ./checkmetrics.sh /usr/bin/promtool e2e-output.txt"
    exit 1
fi

# Ignore known issues in auto-generated and network specific collectors.
lint=$($1 check metrics < "$2" 2>&1 | grep -v -E "^node_(entropy|memory|netstat|wifi_station)_")

if [[ -n $lint ]]; then
    echo -e "Some Prometheus metrics do not follow best practices:\n"
    echo "$lint"

    exit 1
fi