aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rwxr-xr-xcheckmetrics.sh10
2 files changed, 6 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index daa51ff..504ed3d 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@ DOCKER_ARCHS ?= amd64 armv7 arm64 ppc64le s390x
19 19
20include Makefile.common 20include Makefile.common
21 21
22PROMTOOL_VERSION ?= 2.5.0 22PROMTOOL_VERSION ?= 2.18.1
23PROMTOOL_URL ?= https://github.com/prometheus/prometheus/releases/download/v$(PROMTOOL_VERSION)/prometheus-$(PROMTOOL_VERSION).$(GO_BUILD_PLATFORM).tar.gz 23PROMTOOL_URL ?= https://github.com/prometheus/prometheus/releases/download/v$(PROMTOOL_VERSION)/prometheus-$(PROMTOOL_VERSION).$(GO_BUILD_PLATFORM).tar.gz
24PROMTOOL ?= $(FIRST_GOPATH)/bin/promtool 24PROMTOOL ?= $(FIRST_GOPATH)/bin/promtool
25 25
@@ -129,9 +129,5 @@ test-docker:
129promtool: $(PROMTOOL) 129promtool: $(PROMTOOL)
130 130
131$(PROMTOOL): 131$(PROMTOOL):
132 $(eval PROMTOOL_TMP := $(shell mktemp -d))
133 curl -s -L $(PROMTOOL_URL) | tar -xvzf - -C $(PROMTOOL_TMP)
134 mkdir -p $(FIRST_GOPATH)/bin 132 mkdir -p $(FIRST_GOPATH)/bin
135 cp $(PROMTOOL_TMP)/prometheus-$(PROMTOOL_VERSION).$(GO_BUILD_PLATFORM)/promtool $(FIRST_GOPATH)/bin/promtool 133 curl -fsS -L $(PROMTOOL_URL) | tar -xvzf - -C $(FIRST_GOPATH)/bin --no-anchored --strip 1 promtool
136 rm -r $(PROMTOOL_TMP)
137
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