Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to using hashicorp/[email protected] #22080

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

mkeeler
Copy link
Member

@mkeeler mkeeler commented Jan 16, 2025

Description

Migrate Consul to using hashicorp/go-metrics instead of armon/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 to hashicorp/go-metrics, I added the hashicorpmetrics build tag.

This should be a non-functional change but unblocks future go-metrics updates.

I also bumped the serf and memberlist dependencies within the api 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 new compat package within hashicorp/go-metrics that allow for swapping the underlying metrics module used between armon/go-metrics and hashicorp/go-metrics with the build tag.

Testing & Reproduction steps

  • make dev-build
  • mkdir data
  • `consul agent -server -data-dir $(pwd)/data -bind 127.0.0.1 -bootstrap -hcl 'raft_logstore { backend = "boltdb" }'
  • curl localhost:8500/v1/agent/metrics and then verify metrics are present from raft, raft-boltdb/v2, memberlist and serf.
  • Stop the Consul server
  • rm -rf data/* to wipe the data directory
  • `consul agent -server -data-dir $(pwd)/data -bind 127.0.0.1 -bootstrap
  • curl localhost:8500/v1/agent/metrics and then verify metrics are present from raft, raft-wal, memberlist and serf.

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

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

This also requires bumping the dependencies for:

* memberlist
* serf
* raft
* raft-boltdb/v2
@mkeeler mkeeler requested a review from a team as a code owner January 16, 2025 19:54
@github-actions github-actions bot added theme/api Relating to the HTTP API interface theme/health-checks Health Check functionality theme/config Relating to Consul Agent configuration, including reloading theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies type/ci Relating to continuous integration (CI) tooling for testing or releases pr/dependencies PR specifically updates dependencies of project theme/envoy/xds Related to Envoy support theme/contributing Additions and enhancements to community contributing materials theme/internals Serf, Raft, SWIM, Lifeguard, Anti-Entropy, locking topics theme/agent-cache Agent Cache labels Jan 16, 2025
@mkeeler mkeeler added pr/no-backport pr/no-changelog PR does not need a corresponding .changelog entry labels Jan 16, 2025
@mkeeler mkeeler requested a review from a team as a code owner January 17, 2025 15:41
@mkeeler mkeeler requested a review from jeanneryan January 17, 2025 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/dependencies PR specifically updates dependencies of project pr/no-backport pr/no-changelog PR does not need a corresponding .changelog entry theme/agent-cache Agent Cache theme/api Relating to the HTTP API interface theme/config Relating to Consul Agent configuration, including reloading theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies theme/contributing Additions and enhancements to community contributing materials theme/envoy/xds Related to Envoy support theme/health-checks Health Check functionality theme/internals Serf, Raft, SWIM, Lifeguard, Anti-Entropy, locking topics type/ci Relating to continuous integration (CI) tooling for testing or releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant