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 #91

Merged
merged 4 commits into from
Jan 15, 2025
Merged

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)

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 16:20
@mkeeler
Copy link
Member Author

mkeeler commented Jan 8, 2025

golangci-lint seems to be having issues. It looks like it runs for too long and eventually gets killed off. Running locally doesn't produce any finding though.

@dhiaayachi dhiaayachi requested a review from srahul3 January 14, 2025 15:53
dhiaayachi
dhiaayachi previously approved these changes Jan 14, 2025
Copy link
Collaborator

@dhiaayachi dhiaayachi left a comment

Choose a reason for hiding this comment

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

LGTM! Left a question about linter, but nothing blocking.

.github/workflows/ci.yaml Show resolved Hide resolved
@mkeeler mkeeler merged commit 5707d10 into main Jan 15, 2025
8 checks passed
@mkeeler mkeeler deleted the metrics-compat branch January 15, 2025 15:14
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