mirror of
				https://github.com/prometheus/node_exporter.git
				synced 2025-08-20 18:33:52 -07:00 
			
		
		
		
	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>
		
			
				
	
	
		
			17 lines
		
	
	
		
			444 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			444 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
| #!/usr/bin/env bash
 | |
| 
 | |
| if [[ ( -z "$1" ) || ( -z "$2" ) ]]; then
 | |
|     echo "usage: ./checkmetrics.sh /usr/bin/promtool e2e-output.txt"
 | |
|     exit 1
 | |
| fi
 | |
| 
 | |
| # 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 [[ -n $lint ]]; then
 | |
|     echo -e "Some Prometheus metrics do not follow best practices:\n"
 | |
|     echo "$lint"
 | |
| 
 | |
|     exit 1
 | |
| fi
 |