Skip to content

Commit

Permalink
Fix deprecated NewBuildInfoCollector API
Browse files Browse the repository at this point in the history
Update `examples/random/main.go`:
  `prometheus.NewBuildInfoCollector` is deprecated. Use `collectors.NewBuildInfoCollector` instead.

Signed-off-by: alissa-tung <[email protected]>
  • Loading branch information
alissa-tung authored and kakkoyun committed May 13, 2022
1 parent 39cf574 commit 585540a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/random/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 585540a

Please sign in to comment.