aboutsummaryrefslogtreecommitdiff
path: root/checkmetrics.sh
diff options
context:
space:
mode:
authorTobias Schmidt <tobidt@gmail.com>2020-06-02 23:45:24 +0200
committerGitHub <noreply@github.com>2020-06-02 23:45:24 +0200
commit2c433cdac30181ac078c8558dc43c5da42638c07 (patch)
tree1b31c7e85b301e919fe90189aebe6ccfa61e29db /checkmetrics.sh
parent02532771213fcb024608043d7b1e514c1a80c2da (diff)
downloadprometheus_node_collector-2c433cdac30181ac078c8558dc43c5da42638c07.tar.bz2
prometheus_node_collector-2c433cdac30181ac078c8558dc43c5da42638c07.tar.xz
prometheus_node_collector-2c433cdac30181ac078c8558dc43c5da42638c07.zip
Fix and simplify checkmetrics make target (#1731)
The checkmetrics target currently uses promtool v2.5.0 which doesn't include many improvements done over the time. This change also simplifies the promtool installation, avoiding a temporary directory by extracting the file directly to the target destination. Signed-off-by: Tobias Schmidt <tobidt@gmail.com>
Diffstat (limited to 'checkmetrics.sh')
-rwxr-xr-xcheckmetrics.sh10
1 files changed, 4 insertions, 6 deletions
diff --git a/checkmetrics.sh b/checkmetrics.sh
index 5d846cc..c3104ca 100755
--- a/checkmetrics.sh
+++ b/checkmetrics.sh
@@ -5,14 +5,12 @@ if [[ ( -z "$1" ) || ( -z "$2" ) ]]; then
5 exit 1 5 exit 1
6fi 6fi
7 7
8# Only check node_exporter's metrics, as the Prometheus Go client currently 8# Ignore known issues in auto-generated and network specific collectors.
9# exposes a metric with a unit of microseconds. Once that is fixed, remove 9lint=$($1 check metrics < "$2" 2>&1 | grep -v -E "^node_(entropy|memory|netstat|wifi_station)_")
10# this filter.
11lint=$($1 check metrics < $2 2>&1 | grep "node_")
12 10
13if [[ ! -z $lint ]]; then 11if [[ -n $lint ]]; then
14 echo -e "Some Prometheus metrics do not follow best practices:\n" 12 echo -e "Some Prometheus metrics do not follow best practices:\n"
15 echo "$lint" 13 echo "$lint"
16 14
17 exit 1 15 exit 1
18fi \ No newline at end of file 16fi