From 585540a010b33e60cb4755c0ab50649fd2b91c3c Mon Sep 17 00:00:00 2001 From: alissa-tung Date: Wed, 16 Mar 2022 17:46:48 +0800 Subject: [PATCH] Fix deprecated `NewBuildInfoCollector` API Update `examples/random/main.go`: `prometheus.NewBuildInfoCollector` is deprecated. Use `collectors.NewBuildInfoCollector` instead. Signed-off-by: alissa-tung --- examples/random/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/random/main.go b/examples/random/main.go index cf44863..1321423 100644 --- a/examples/random/main.go +++ b/examples/random/main.go @@ -26,6 +26,7 @@ import ( "time" "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/collectors" "github.com/prometheus/client_golang/prometheus/promhttp" ) @@ -67,7 +68,7 @@ func main() { prometheus.MustRegister(rpcDurations) prometheus.MustRegister(rpcDurationsHistogram) // Add Go module build info. - prometheus.MustRegister(prometheus.NewBuildInfoCollector()) + prometheus.MustRegister(collectors.NewBuildInfoCollector()) start := time.Now()