diff --git a/go.mod b/go.mod index 60710ea11..3d6b1ff16 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.19 require ( github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 github.com/alicebob/miniredis v2.5.0+incompatible - github.com/armon/go-metrics v0.3.10 github.com/aws/aws-sdk-go v1.44.321 github.com/cespare/xxhash v1.1.0 github.com/cristalhq/hedgedhttp v0.7.0 @@ -23,6 +22,7 @@ require ( github.com/grafana/gomemcache v0.0.0-20230316202710-a081dae0aba9 github.com/hashicorp/consul/api v1.15.3 github.com/hashicorp/go-cleanhttp v0.5.2 + github.com/hashicorp/go-metrics v0.5.1 github.com/hashicorp/go-sockaddr v1.0.2 github.com/hashicorp/golang-lru/v2 v2.0.5 github.com/hashicorp/memberlist v0.3.1 @@ -58,6 +58,7 @@ require ( require ( github.com/OneOfOne/xxhash v1.2.6 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect + github.com/armon/go-metrics v0.3.10 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd // indirect diff --git a/go.sum b/go.sum index fba0aaa1d..58d4699d1 100644 --- a/go.sum +++ b/go.sum @@ -632,6 +632,8 @@ github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39 github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.0 h1:8exGP7ego3OmkfksihtSouGMZ+hQrhxx+FVELeXpVPE= github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.1 h1:rfPwUqFU6uZXNvGl4hzjY8LEBsqFVU4si1H9/Hqck/U= +github.com/hashicorp/go-metrics v0.5.1/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= diff --git a/kv/memberlist/metrics.go b/kv/memberlist/metrics.go index 75a6b2324..b4867e743 100644 --- a/kv/memberlist/metrics.go +++ b/kv/memberlist/metrics.go @@ -3,9 +3,9 @@ package memberlist import ( "time" - armonmetrics "github.com/armon/go-metrics" - armonprometheus "github.com/armon/go-metrics/prometheus" "github.com/go-kit/log/level" + "github.com/hashicorp/go-metrics" + hashiprometheus "github.com/hashicorp/go-metrics/prometheus" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" @@ -177,16 +177,16 @@ func (m *KV) createAndRegisterMetrics() { m.registerer.MustRegister(m) - // memberlist uses armonmetrics package for internal usage - // here we configure armonmetrics to use prometheus. - opts := armonprometheus.PrometheusOpts{ + // memberlist uses metrics package for internal usage + // here we configure metrics to use prometheus. + opts := hashiprometheus.PrometheusOpts{ Expiration: 0, // Don't expire metrics. Registerer: m.registerer, } - sink, err := armonprometheus.NewPrometheusSinkFrom(opts) + sink, err := hashiprometheus.NewPrometheusSinkFrom(opts) if err == nil { - cfg := armonmetrics.DefaultConfig("") + cfg := metrics.DefaultConfig("") cfg.EnableHostname = false // no need to put hostname into metric cfg.EnableHostnameLabel = false // no need to put hostname into labels cfg.EnableServiceLabel = false // Don't put service name into a label. (We don't set service name anyway). @@ -194,7 +194,7 @@ func (m *KV) createAndRegisterMetrics() { cfg.EnableTypePrefix = true // to make better sense of internal memberlist metrics cfg.TimerGranularity = time.Second // timers are in seconds in prometheus world - _, err = armonmetrics.NewGlobal(cfg, sink) + _, err = metrics.NewGlobal(cfg, sink) } if err != nil {