-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
Overview of the Issue
The Consul repository imports github.com/armon/go-metrics
, which has been renamed and moved to github.com/hashicorp/go-metrics
. This causes conflicts and import issues downstream, especially when other dependencies require the new import path (hashicorp/go-metrics
). For example, when integrating Consul with other libraries, Go's module system encounters ambiguities and requires manual replace directives, which do not always fully resolve the issues.
This breaks importing libraries such as github.com/mennanov/limiters
. Attempting to import this library fails due to the conflicting metric library dependencies.
Reproduction Steps
- Create a new Go project.
- Run the following command:
go get github.com/mennanov/[email protected]
- Observe the following error:
go: github.com/mennanov/limiters imports
github.com/hashicorp/consul/api imports
github.com/hashicorp/serf/coordinate imports
github.com/hashicorp/go-metrics/compat imports
github.com/armon/go-metrics: github.com/armon/[email protected]: parsing go.mod:
module declares its path as: github.com/hashicorp/go-metrics
but was required as: github.com/armon/go-metrics
Consul info for both Client and Server
N/A (problem is with module resolution, not a running agent)
Operating system and Environment details
- Go version: (reproducible with Go 1.21+)
- Any OS/Arch
Log Fragments
N/A
Notes
- The problem arises from a mismatch between
github.com/armon/go-metrics
andgithub.com/hashicorp/go-metrics
in the dependency tree. - Because of this,
limiters
cannot be imported without manual fixes.
Request
Could this dependency be updated or fixed in Consul?
Any guidance on a workaround would be very helpful.
Thank you for your help!