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
39cf574e99
commit
585540a010
|
@ -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