aboutsummaryrefslogtreecommitdiff
path: root/checkmetrics.sh
diff options
context:
space:
mode:
authorMatt Layher <mdlayher@gmail.com>2018-02-13 12:04:03 -0500
committerBen Kochie <superq@gmail.com>2018-02-13 18:04:03 +0100
commitdcb31670d63235cdd0ff0de03fe283980ce4e543 (patch)
treef381f3927b63489e093b50dd52c42f314e610515 /checkmetrics.sh
parent3de2542d21da8b15db960677ad82a7d74d306714 (diff)
downloadprometheus_node_collector-dcb31670d63235cdd0ff0de03fe283980ce4e543.tar.bz2
prometheus_node_collector-dcb31670d63235cdd0ff0de03fe283980ce4e543.tar.xz
prometheus_node_collector-dcb31670d63235cdd0ff0de03fe283980ce4e543.zip
Makefile: add checkmetrics target, use in CI (#797)
Diffstat (limited to 'checkmetrics.sh')
-rwxr-xr-xcheckmetrics.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/checkmetrics.sh b/checkmetrics.sh
new file mode 100755
index 0000000..5d846cc
--- /dev/null
+++ b/checkmetrics.sh
@@ -0,0 +1,18 @@
1#!/usr/bin/env bash
2
3if [[ ( -z "$1" ) || ( -z "$2" ) ]]; then
4 echo "usage: ./checkmetrics.sh /usr/bin/promtool e2e-output.txt"
5 exit 1
6fi
7
8# Only check node_exporter's metrics, as the Prometheus Go client currently
9# exposes a metric with a unit of microseconds. Once that is fixed, remove
10# this filter.
11lint=$($1 check metrics < $2 2>&1 | grep "node_")
12
13if [[ ! -z $lint ]]; then
14 echo -e "Some Prometheus metrics do not follow best practices:\n"
15 echo "$lint"
16
17 exit 1
18fi \ No newline at end of file