Skip to content

Commit

Permalink
Adopt use of prometheus/exporter-toolkit
Browse files Browse the repository at this point in the history
exporter-toolkit provides easy implementation of TLS support and other
niceties such as generation of a uniform landing page.

Bump prometheus/client_golang and prometheus/common dependencies to more
recent versions.

Signed-off-by: Daniel Swarbrick <[email protected]>
  • Loading branch information
dswarbrick authored and boynux committed Jun 24, 2024
1 parent 0c2b754 commit 268f7b3
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 479 deletions.
3 changes: 3 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type Labels struct {
/*Config configurations for exporter */
type Config struct {
ListenAddress string
WebConfigFile string
MetricPath string
Labels Labels
ExtractServiceTimes bool
Expand All @@ -62,6 +63,8 @@ func NewConfig() *Config {

flag.StringVar(&c.ListenAddress, "listen",
loadEnvStringVar(squidExporterListenKey, defaultListenAddress), "Address and Port to bind exporter, in host:port format")
flag.StringVar(&c.WebConfigFile, "web.config.file", "",
"Path to configuration file that can enable TLS or authentication. See: https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md")
flag.StringVar(&c.MetricPath, "metrics-path",
loadEnvStringVar(squidExporterMetricsPathKey, defaultMetricsPath), "Metrics path to expose prometheus metrics")

Expand Down
30 changes: 21 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,34 @@ module github.com/boynux/squid-exporter
go 1.19

require (
github.com/go-kit/log v0.2.1
github.com/pires/go-proxyproto v0.6.2
github.com/prometheus/client_golang v1.12.2
github.com/prometheus/common v0.34.0
github.com/prometheus/client_golang v1.19.0
github.com/prometheus/common v0.53.0
github.com/prometheus/exporter-toolkit v0.11.0
github.com/stretchr/testify v1.7.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
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/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d // indirect
google.golang.org/protobuf v1.28.0 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
)
Loading

0 comments on commit 268f7b3

Please sign in to comment.