Skip to content

Commit

Permalink
Merge pull request #1000 from alissa-tung/patch-1
Browse files Browse the repository at this point in the history
Fix deprecated `NewBuildInfoCollector` API
  • Loading branch information
kakkoyun committed Mar 17, 2022
2 parents 6c18569 + ffd6362 commit fe8d1e1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion Dockerfile
@@ -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
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 fe8d1e1

Please sign in to comment.