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.
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
https://github.com/nspcc-dev/neofs-node/pull/3016
3682