Skip to content

Commit

Permalink
Upgrade exporter-toolkit (#151)
Browse files Browse the repository at this point in the history
Update to the latest exporter-toolkit.

Signed-off-by: SuperQ <superq@gmail.com>

Signed-off-by: SuperQ <superq@gmail.com>
  • Loading branch information
SuperQ committed Nov 9, 2022
1 parent 0d03be4 commit 4add019
Show file tree
Hide file tree
Showing 3 changed files with 305 additions and 36 deletions.
11 changes: 4 additions & 7 deletions bind_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,17 +519,15 @@ func main() {
bindVersion = kingpin.Flag("bind.stats-version",
"BIND statistics version. Can be detected automatically.",
).Default("auto").Enum("xml.v2", "xml.v3", "auto")
webConfig = webflag.AddFlags(kingpin.CommandLine)
listenAddress = kingpin.Flag("web.listen-address",
"Address to listen on for web interface and telemetry",
).Default(":9119").String()
metricsPath = kingpin.Flag(
"web.telemetry-path", "Path under which to expose metrics",
).Default("/metrics").String()

groups statisticGroups
)

toolkitFlags := webflag.AddFlags(kingpin.CommandLine, ":9119")

kingpin.Flag("bind.stats-groups",
"Comma-separated list of statistics to collect",
).Default((&statisticGroups{
Expand All @@ -556,7 +554,6 @@ func main() {
prometheus.MustRegister(procExporter)
}

level.Info(logger).Log("msg", "Listening on", "address", *listenAddress)
http.Handle(*metricsPath, promhttp.Handler())
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(`<html>
Expand All @@ -567,8 +564,8 @@ func main() {
</body>
</html>`))
})
srv := &http.Server{Addr: *listenAddress}
if err := web.ListenAndServe(srv, *webConfig, logger); err != nil {
srv := &http.Server{}
if err := web.ListenAndServe(srv, toolkitFlags, logger); err != nil {
level.Error(logger).Log("err", err)
os.Exit(1)
}
Expand Down
24 changes: 13 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,33 @@ go 1.17

require (
github.com/go-kit/log v0.2.1
github.com/prometheus/client_golang v1.12.2
github.com/prometheus/client_golang v1.13.0
github.com/prometheus/common v0.37.0
github.com/prometheus/exporter-toolkit v0.7.1
github.com/prometheus/exporter-toolkit v0.8.1
gopkg.in/alecthomas/kingpin.v2 v2.2.6
)

require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/coreos/go-systemd/v22 v22.4.0 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a // indirect
golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/protobuf v1.26.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 4add019

Please sign in to comment.