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 hashicorp/go-metrics compatibility #132

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

Conversation

mkeeler
Copy link
Member

@mkeeler mkeeler commented Jan 8, 2025

This PR migrates the library to using github.com/hashicorp/go-metrics/compat instead of github.com/armon/go-metrics.

Applications consuming the library can control whether metrics get emitted to either armon/go-metrics or hashicorp/go-metrics by specifying either the armonmetrics or hashicorpmetrics build tags. The default behavior is currently to prefer armon/go-metrics for maximum backwards compatibility.

Future PRs will:

  • Bump the hashicorp/go-metrics version to one where the default behavior is to emit metrics using hashicorp/go-metrics (Timeline: mid-2025)
  • Remove compat package usage with direct usage of hashicorp/go-metrics (Timeline: end-2025)

The RFC with more details about this is here

TODO:

  • Pull in a tagged version of hashicorp/go-metrics once upstream PR is merged

Compatability is attained with build tags

Using tag armonmetrics or no tag at all will result in the library utilizing github.com/armon/go-metrics for metrics emission (like the library historically has done)

Using tag hashicorpmetrics will result in the library utilizing the updated github.com/hashicorp/go-metrics for metrics emission.
@mkeeler mkeeler requested a review from a team as a code owner January 8, 2025 17:06
Copy link
Contributor

@fairclothjm fairclothjm 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