mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2026-03-01 04:28:51 +00:00
Provide RegisterMetrics() functions in packages that expose metrics #1428
Labels
No labels
I1
I2
I3
I4
S1
S2
S3
S4
U0
U1
U2
U3
U3
U4
blocked
bug
bug
cli
compiler
config
config
consensus
dependencies
discussion
documentation
enhancement
epic
feature
go
good first issue
help wanted
neotest
network
oracle
performance
question
rpc
security
smartcontract
task
task
task
test
vm
wallet
windows
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neo-go#1428
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @roman-khimov on GitHub (Nov 22, 2024).
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