version: change prom metric to have separate label with build time
This commit is contained in:
		@@ -84,10 +84,11 @@ func RegisterMetric(registry prometheus.Registerer) {
 | 
			
		||||
			Name: "build_info",
 | 
			
		||||
			Help: "Build information",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"version"},
 | 
			
		||||
		[]string{"version", "build"},
 | 
			
		||||
	)
 | 
			
		||||
	registry.MustRegister(buildInfo)
 | 
			
		||||
	buildInfo.WithLabelValues(Version()).Set(1)
 | 
			
		||||
	info := VersionInfo()
 | 
			
		||||
	buildInfo.WithLabelValues(fmt.Sprintf("%s/%s", info.Version, info.GitRev), info.BuildTime).Set(1)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var v string
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user