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

Introduce compat package to ease migration from the old armon/go-metrice module name to the current hashicorp/go-metrics name #169

Merged
merged 3 commits into from
Jan 8, 2025

Conversation

mkeeler
Copy link
Member

@mkeeler mkeeler commented Dec 17, 2024

Introduce the backwards compatibility layer with armon/go-metrics.

The compat package (and its sub-packages) are API compatible with armon/go-metrics@v0.4.1 or hashicorp/go-metrics@v0.5.0. The underlying metrics module will be selected for all consumers of the compat package by utilizing Go build tags.

  • armonmetrics - Using this tag will cause metrics to be emitted via armon/go-metrics
  • hashicorpmetrics - Using this tag will cause metrics to be emitted via hashicorp/go-metrics

If no build tag is specified the default behavior will be to use armon/go-metrics (however this behavior will be scheduled to change in 6 months).

The intention is that libraries will be updated to consume the compat package and then applications/services that produce the final binaries can use the build tags to control metrics emission globally for all libraries.

…trics module name to the current hashicorp/go-metrics name
@mkeeler mkeeler requested a review from a team as a code owner December 17, 2024 18:30
mukeshjc
mukeshjc previously approved these changes Jan 6, 2025
README.md Outdated
will never get exported.

Eventually all usage of `armon/go-metrics` should be replaced with usage of `hashicorp/go-metrics`. However, a single
point-in-time coordinated update across all libraries than an application may depend on isn't always feasible. To faciliate migrations,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: typo
... across all libraries that an application ...
... To facilitate migrations ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is fixed now.

Copy link
Contributor

@mukeshjc mukeshjc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants