Provide RegisterMetrics() functions in packages that expose metrics #3698
Labels
enhancement
Improving existing functionality
I3
Minimal impact
S3
Minimally significant
U4
Nothing urgent
Is your feature request related to a problem? Please describe.
I'm always frustrated when I realize that we always register our metrics in
init()
in every package that exposes them. On one hand it's convenient, but on the other some package users may want to opt out from our metrics.Describe the solution you'd like
Keep metrics package-level, but expose some
RegisterMetrics()
function (accepting a registry?) that will do metric registration. Call it in cli/server and everywhere else needed. Keep in mind that variables still need to be initialized properly in every package.Describe alternatives you've considered
Keep things as is, works too.
Additional context
nspcc-dev/neofs-node#3016
#3682
The text was updated successfully, but these errors were encountered: