Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Migrate Consul to using
hashicorp/go-metrics
instead ofarmon/go-metrics
.This necessarily includes updates to the following dependencies:
raft
raft-boltdb/v2
raft-wal
memberlist
serf
All of those libraries were previously updated to support compatibility with
hashicorp/go-metrics
. In order to get the metrics for those libraries flowing out tohashicorp/go-metrics
, I added thehashicorpmetrics
build tag.This should be a non-functional change but unblocks future go-metrics updates.
I also bumped the
serf
andmemberlist
dependencies within theapi
module. While that module doesn't cause any metrics to be invoked, I wanted to ensure only the latest versions with metrics compatibility would be directly relied upon.Note that
armon/go-metrics
still appears as an indirect dependency in go.mod. This is because of a newcompat
package withinhashicorp/go-metrics
that allow for swapping the underlying metrics module used betweenarmon/go-metrics
andhashicorp/go-metrics
with the build tag.Testing & Reproduction steps
make dev-build
mkdir data
curl localhost:8500/v1/agent/metrics
and then verify metrics are present fromraft
,raft-boltdb/v2
,memberlist
andserf
.rm -rf data/*
to wipe the data directorycurl localhost:8500/v1/agent/metrics
and then verify metrics are present fromraft
,raft-wal
,memberlist
andserf
.In my own testing I have verified that at least one metric from all the affected libraries are still emitted correctly along with normal Consul metrics.
Note the agent is run twice with the different raft log stores to ensure both metrics from boltdb or the WAL are being emitted
PR Checklist