File: checkmetrics.sh

package info (click to toggle)
prometheus-node-exporter 0.17.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,576 kB
  • sloc: ansic: 1,377; sh: 868; python: 304; makefile: 182; awk: 60; asm: 2
file content (18 lines) | stat: -rwxr-xr-x 492 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash

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

# Only check node_exporter's metrics, as the Prometheus Go client currently
# exposes a metric with a unit of microseconds.  Once that is fixed, remove
# this filter.
lint=$($1 check metrics < $2 2>&1 | grep "node_")

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

    exit 1
fi