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"
|
"time"
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
|
"github.com/prometheus/client_golang/prometheus/collectors"
|
||||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -67,7 +68,7 @@ func main() {
|
||||||
prometheus.MustRegister(rpcDurations)
|
prometheus.MustRegister(rpcDurations)
|
||||||
prometheus.MustRegister(rpcDurationsHistogram)
|
prometheus.MustRegister(rpcDurationsHistogram)
|
||||||
// Add Go module build info.
|
// Add Go module build info.
|
||||||
prometheus.MustRegister(prometheus.NewBuildInfoCollector())
|
prometheus.MustRegister(collectors.NewBuildInfoCollector())
|
||||||
|
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue