Skip to content
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

Update example Dockerfile and random/main.go #918

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -27,6 +27,7 @@ import (

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/client_golang/prometheus/collectors"
)

var (
Expand Down Expand Up @@ -65,7 +66,7 @@ func init() {
prometheus.MustRegister(rpcDurations)
prometheus.MustRegister(rpcDurationsHistogram)
// Add Go module build info.
prometheus.MustRegister(prometheus.NewBuildInfoCollector())
prometheus.MustRegister(collectors.NewBuildInfoCollector())
}

func main() {
Expand Down