-
Notifications
You must be signed in to change notification settings - Fork 2k
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] #24856
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just want to check a couple points before approving.
@@ -5,7 +5,6 @@ go 1.23 | |||
// Pinned dependencies are noted in github.com/hashicorp/nomad/issues/11826. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noting that our reason for pinning a specific version of armon/go-metrics appears to have been resolved years ago: hashicorp/go-metrics#146
So dropping this pinning is not only ok, but a great side effect.
This also requires bumping the dependencies for: * memberlist * serf * raft * raft-boltdb * (and indirectly hashicorp/mdns due to the memberlist or serf update) Unlike some other HashiCorp products, Nomads root module is currently expected to be consumed by others. This means that it needs to be treated more like our libraries and upgrade to hashicorp/go-metrics by utilizing its compat packages. This allows those importing the root module to control the metrics module used via build tags.
402f62d
to
b5b7587
Compare
@schmichael I think this is ready for a final look. I migrated the Nomad root module to utilizing the compat package to ensure all those importing that module can control which metric module is used. |
Also while Consul's API package has a memberlist/serf dependency, I have not updated that module in this PR because the equivalent Consul PRs haven't landed yet. This should be perfectly fine because Consul's API package doesn't emit metrics and only uses those dependencies for Coordinate structures types (which Nomad doesn't consume anyways). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks so much for taking this on @mkeeler !
Description
On the surface this is a fairly mechanical change in deps and imports. Instead of consuming armon/go-metrics, Nomad will now use the latest version of hashicorp/go-metrics. Previous attempts to upgrade resulted in missing metrics and were reverted. This time is different because all libraries within the
hashicorp
namespace have been instrumented to use a specialcompat
package withinhashicorp/go-metrics
to allow for a compile time build tag to control the metrics module used by all libraries.This PR does 3 things:
armon/go-metrics
tohashicorp/go-metrics
GO_TAGS
variable handling within the makefile to use thehashicorpmetrics
build tag (global library opt-in to metrics emission via thehashicorp/go-metrics
module)Testing & Reproduction steps
make dev
mkdir data
nomad agent -server -data-dir $(pwd)/data
curl localhost:4646/v1/metrics
Now ensure that metrics from all the libraries are still seen. I checked that there was at least one from serf, memberlist, raft and raft-boltdb.
Contributor Checklist
changelog entry using the
make cl
command.and job configuration, please update the Nomad website documentation to reflect this. Refer to
the website README for docs guidelines. Please also consider whether the
change requires notes within the upgrade guide.
Reviewer Checklist
backporting document.
in the majority of situations. The main exceptions are long-lived feature branches or merges where
history should be preserved.
within the public repository.