-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metrics: capture reorg distances and depths #11435
Conversation
Is a gauge an appropriate choice for reorgs? Shouldn't it be a histogram? |
How do you plan to use these metrics? |
beacon-chain/blockchain/metrics.go
Outdated
Help: "Captures distance of reorgs", | ||
Buckets: []float64{1, 2, 4, 8, 16, 32, 64}, | ||
}, | ||
) | ||
reorgDepth = promauto.NewHistogram( | ||
prometheus.HistogramOpts{ | ||
Name: "reorg_depth", | ||
Help: "Captures depth of reorgs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add some details to the help text? I.e. what does depth / distance mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add some details to the help text? I.e. what does depth / distance mean?
Yep. Done
What does this PR do? Why is it needed?
This PR captures reorg depth and reorg distance metrics. We'll like to monitor reorg and distance and depths using metrics.
Distance is say you reorg x to y, how many steps it took to get from x to y. Depth is say how many steps it takes to get to a common ancestor
Which issues(s) does this PR fix?
N/A
Other notes for review
Gauge wasn't picked because of the inaccurate count. It depends on the sample rate of Prometheus. If Prometheus is down for a minute and two reorgs happen, we'll likely not be able to capture them all. Histogram seems like the best option