Skip to content

Introduce hashicorp/go-metrics compatibility#91

Merged
mkeeler merged 4 commits intomainfrom
metrics-compat
Jan 15, 2025
Merged

Introduce hashicorp/go-metrics compatibility#91
mkeeler merged 4 commits intomainfrom
metrics-compat

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

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

@mkeeler mkeeler merged commit 5707d10 into main Jan 15, 2025
7 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