You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Introduce hashicorp/go-metrics compatibility
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 it has historically done)
Using tag hashicorpmetrics will result in the library utilizing the updated github.com/hashicorp/go-metrics for metrics emission.
* Update README.md
* Bump versions of memberlist and go-metrics to pull in go-metrics compat package
Copy file name to clipboardExpand all lines: README.md
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -126,3 +126,29 @@ Tests can be run by typing `make test`.
126
126
127
127
If you make any changes to the code, run `make format` in order to automatically
128
128
format the code according to Go [standards](https://golang.org/doc/effective_go.html#formatting).
129
+
130
+
131
+
## Metrics Emission and Compatibility
132
+
133
+
This library can emit metrics using either `github.com/armon/go-metrics` or `github.com/hashicorp/go-metrics`. Choosing between the libraries is controlled via build tags.
134
+
135
+
**Build Tags**
136
+
*`armonmetrics` - Using this tag will cause metrics to be routed to `armon/go-metrics`
137
+
*`hashicorpmetrics` - Using this tag will cause all metrics to be routed to `hashicorp/go-metrics`
138
+
139
+
If no build tag is specified, the default behavior is to use `armon/go-metrics`.
140
+
141
+
**Deprecating `armon/go-metrics`**
142
+
143
+
Emitting metrics to `armon/go-metrics` is officially deprecated. Usage of `armon/go-metrics` will remain the default until mid-2025 with opt-in support continuing to the end of 2025.
144
+
145
+
**Migration**
146
+
To migrate an application currently using the older `armon/go-metrics` to instead use `hashicorp/go-metrics` the following should be done.
147
+
148
+
1. Upgrade libraries using `armon/go-metrics` to consume `hashicorp/go-metrics/compat` instead. This should involve only changing import statements. All repositories in the `hashicorp` namespace
149
+
2. Update an applications library dependencies to those that have the compatibility layer configured.
150
+
3. Update the application to use `hashicorp/go-metrics` for configuring metrics export instead of `armon/go-metrics`
151
+
* Replace all application imports of `github.com/armon/go-metrics` with `github.com/hashicorp/go-metrics`
152
+
* Instrument your build system to build with the `hashicorpmetrics` tag.
153
+
154
+
Eventually once the default behavior changes to use `hashicorp/go-metrics` by default (mid-2025), you can drop the `hashicorpmetrics` build tag.
0 commit comments