Skip to content

Commit 585540a

Browse files
alissa-tungkakkoyun
authored andcommitted
Fix deprecated NewBuildInfoCollector API
Update `examples/random/main.go`: `prometheus.NewBuildInfoCollector` is deprecated. Use `collectors.NewBuildInfoCollector` instead. Signed-off-by: alissa-tung <[email protected]>
1 parent 39cf574 commit 585540a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: examples/random/main.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"time"
2727

2828
"github.com/prometheus/client_golang/prometheus"
29+
"github.com/prometheus/client_golang/prometheus/collectors"
2930
"github.com/prometheus/client_golang/prometheus/promhttp"
3031
)
3132

@@ -67,7 +68,7 @@ func main() {
6768
prometheus.MustRegister(rpcDurations)
6869
prometheus.MustRegister(rpcDurationsHistogram)
6970
// Add Go module build info.
70-
prometheus.MustRegister(prometheus.NewBuildInfoCollector())
71+
prometheus.MustRegister(collectors.NewBuildInfoCollector())
7172

7273
start := time.Now()
7374

0 commit comments

Comments
 (0)