2018-02-13 09:04:03 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
if [[ ( -z "$1" ) || ( -z "$2" ) ]]; then
|
|
|
|
echo "usage: ./checkmetrics.sh /usr/bin/promtool e2e-output.txt"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-06-02 14:45:24 -07:00
|
|
|
# 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)_")
|
2018-02-13 09:04:03 -08:00
|
|
|
|
2020-06-02 14:45:24 -07:00
|
|
|
if [[ -n $lint ]]; then
|
2018-02-13 09:04:03 -08:00
|
|
|
echo -e "Some Prometheus metrics do not follow best practices:\n"
|
|
|
|
echo "$lint"
|
|
|
|
|
|
|
|
exit 1
|
2020-06-02 14:45:24 -07:00
|
|
|
fi
|