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

Remove deprecated version function #591

Merged
merged 1 commit into from Mar 7, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -8,7 +8,6 @@ require (
github.com/google/go-cmp v0.6.0
github.com/julienschmidt/httprouter v1.3.0
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
github.com/prometheus/client_golang v1.19.0
github.com/prometheus/client_model v0.6.0
golang.org/x/net v0.21.0
golang.org/x/oauth2 v0.17.0
Expand All @@ -23,6 +22,7 @@ require (
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/prometheus/client_golang v1.19.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
Expand Down
29 changes: 0 additions & 29 deletions version/info.go
Expand Up @@ -19,8 +19,6 @@ import (
"runtime"
"strings"
"text/template"

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

// Build information. Populated at build-time.
Expand All @@ -35,33 +33,6 @@ var (
GoArch = runtime.GOARCH
)

// Deprecated: Use github.com/prometheus/client_golang/prometheus/collectors/version.NewCollector instead.
//
// NewCollector returns a collector that exports metrics about current version
// information.
func NewCollector(program string) prometheus.Collector {
return prometheus.NewGaugeFunc(
prometheus.GaugeOpts{
Namespace: program,
Name: "build_info",
Help: fmt.Sprintf(
"A metric with a constant '1' value labeled by version, revision, branch, goversion from which %s was built, and the goos and goarch for the build.",
program,
),
ConstLabels: prometheus.Labels{
"version": Version,
"revision": GetRevision(),
"branch": Branch,
"goversion": GoVersion,
"goos": GoOS,
"goarch": GoArch,
"tags": GetTags(),
},
},
func() float64 { return 1 },
)
}

// versionInfoTmpl contains the template used by Info.
var versionInfoTmpl = `
{{.program}}, version {{.version}} (branch: {{.branch}}, revision: {{.revision}})
Expand Down