forked from mirror/client_golang
Fix deprecated `NewBuildInfoCollector` API
Update `examples/random/main.go`: `prometheus.NewBuildInfoCollector` is deprecated. Use `collectors.NewBuildInfoCollector` instead. Signed-off-by: alissa-tung <alissa-tung@outlook.com>
This commit is contained in:
parent
1f81b3e913
commit
b05177a553
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue