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>
This commit is contained in:
parent
0253277121
commit
2c433cdac3
2 changed files with 6 additions and 12 deletions
|
|
@ -5,14 +5,12 @@ if [[ ( -z "$1" ) || ( -z "$2" ) ]]; then
|
|||
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_")
|
||||
# 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 [[ ! -z $lint ]]; then
|
||||
if [[ -n $lint ]]; then
|
||||
echo -e "Some Prometheus metrics do not follow best practices:\n"
|
||||
echo "$lint"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue