Skip to content

Commit 6aadcf4

Browse files
authored
Remove deprecated version function (#591)
Remove deprecated version.NewCollector function. This has been moved to `github.com/prometheus/client_golang`. This fixes the circular dependency between the two repos. Signed-off-by: SuperQ <superq@gmail.com>
1 parent 1e6ac24 commit 6aadcf4

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ require (
88
github.com/google/go-cmp v0.6.0
99
github.com/julienschmidt/httprouter v1.3.0
1010
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
11-
github.com/prometheus/client_golang v1.19.0
1211
github.com/prometheus/client_model v0.6.0
1312
golang.org/x/net v0.21.0
1413
golang.org/x/oauth2 v0.17.0
@@ -23,6 +22,7 @@ require (
2322
github.com/go-logfmt/logfmt v0.5.1 // indirect
2423
github.com/golang/protobuf v1.5.3 // indirect
2524
github.com/jpillora/backoff v1.0.0 // indirect
25+
github.com/prometheus/client_golang v1.19.0 // indirect
2626
github.com/prometheus/procfs v0.12.0 // indirect
2727
github.com/rogpeppe/go-internal v1.10.0 // indirect
2828
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect

version/info.go

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import (
1919
"runtime"
2020
"strings"
2121
"text/template"
22-
23-
"github.com/prometheus/client_golang/prometheus"
2422
)
2523

2624
// Build information. Populated at build-time.
@@ -35,33 +33,6 @@ var (
3533
GoArch = runtime.GOARCH
3634
)
3735

38-
// Deprecated: Use github.com/prometheus/client_golang/prometheus/collectors/version.NewCollector instead.
39-
//
40-
// NewCollector returns a collector that exports metrics about current version
41-
// information.
42-
func NewCollector(program string) prometheus.Collector {
43-
return prometheus.NewGaugeFunc(
44-
prometheus.GaugeOpts{
45-
Namespace: program,
46-
Name: "build_info",
47-
Help: fmt.Sprintf(
48-
"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.",
49-
program,
50-
),
51-
ConstLabels: prometheus.Labels{
52-
"version": Version,
53-
"revision": GetRevision(),
54-
"branch": Branch,
55-
"goversion": GoVersion,
56-
"goos": GoOS,
57-
"goarch": GoArch,
58-
"tags": GetTags(),
59-
},
60-
},
61-
func() float64 { return 1 },
62-
)
63-
}
64-
6536
// versionInfoTmpl contains the template used by Info.
6637
var versionInfoTmpl = `
6738
{{.program}}, version {{.version}} (branch: {{.branch}}, revision: {{.revision}})

0 commit comments

Comments
 (0)