Skip to content

Fix deprecated NewBuildInfoCollector API #1000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# This Dockerfile builds an image for a client_golang example.
#
# Use as (from the root for the client_golang repository):
# docker build -f examples/$name/Dockerfile -t prometheus/golang-example-$name .
# docker build -f Dockerfile -t prometheus/golang-example .

# Run as
# docker run -P prometheus/golang-example /random
# or
# docker run -P prometheus/golang-example /simple

# Test as
# curl $ip:$port/metrics

# Builder image, where we build the example.
FROM golang:1 AS builder
Expand Down
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