Skip to content
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

Merged
merged 7 commits into from
Sep 12, 2022
Merged

Conversation

terencechain
Copy link
Member

@terencechain terencechain commented Sep 12, 2022

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

@terencechain terencechain requested a review from a team as a code owner September 12, 2022 06:53
@terencechain terencechain changed the title Metrics Metrics: capture reorg distances and depths Sep 12, 2022
@terencechain terencechain self-assigned this Sep 12, 2022
@prestonvanloon
Copy link
Member

Is a gauge an appropriate choice for reorgs? Shouldn't it be a histogram?

@prestonvanloon
Copy link
Member

How do you plan to use these metrics?

@terencechain
Copy link
Member Author

How do you plan to use these metrics?

I think gauge is more appropriate than histogram. I want to use it like this:

reorg_distance{component="beacon-chain",kubernetes_namespace=~"${namespace:pipe}", cluster=~"${cluster:pipe}", version=~"${version:pipe}"}

Similar to attestations in pool:

Screen Shot 2022-09-12 at 2 52 34 PM

Comment on lines 205 to 212
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",
Copy link
Member

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?

Copy link
Member Author

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

@prylabs-bulldozer prylabs-bulldozer bot merged commit 53627e9 into develop Sep 12, 2022
@delete-merged-branch delete-merged-branch bot deleted the fc-metrics branch September 12, 2022 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants