Skip to content

Add metrics to BlockSync#538

Merged
hvanz merged 9 commits intomainfrom
hernan/add-blocksync-metrics
Mar 22, 2023
Merged

Add metrics to BlockSync#538
hvanz merged 9 commits intomainfrom
hernan/add-blocksync-metrics

Conversation

@hvanz
Copy link
Collaborator

@hvanz hvanz commented Mar 15, 2023

Closes #543


PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments

@hvanz hvanz marked this pull request as ready for review March 17, 2023 15:09
@hvanz hvanz requested a review from a team as a code owner March 17, 2023 15:09
Copy link
Collaborator

@sergio-mena sergio-mena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


// unregisterGauge removes a gauge metric from the Prometheus registry. No new
// data will be generated in the http /metrics endpoint for this metric.
func unregisterGauge(g metrics.Gauge) bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I discussed this with @hvanz on Slack - I really don't think we should be unregistering Prometheus metrics. It seems risky, especially if external metrics systems come to rely on specific metrics being present. Plus it's really non-standard.

If we do really want to unregister metrics, there needs to be a very good reason.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed it synchronously. The best solution will be to unify certain metrics, such as the height, into a node-wide set of metrics. But that will need a bit more work on infra.
I agree we probably want to not unregister upon catching up, even if the resulting graph looks somewhat awkward.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the discussions! As a result, we won't unregister the metrics, and we'll have to think about a better solution for metrics at the node level.

@hvanz hvanz merged commit 2094603 into main Mar 22, 2023
@hvanz hvanz deleted the hernan/add-blocksync-metrics branch March 22, 2023 11:59
faddat pushed a commit to faddat/cometbft that referenced this pull request Feb 25, 2024
* Add 4 metrics related to block

* Remove unused function

* Unregister metrics when BlockSync finishes

* Add changelog

* Rename method

* Move method

* Do not export unregister method

* Do not unregister metrics
faddat added a commit to faddat/cometbft that referenced this pull request Mar 12, 2024
* Add 4 metrics related to block

* Remove unused function

* Unregister metrics when BlockSync finishes

* Add changelog

* Rename method

* Move method

* Do not export unregister method

* Do not unregister metrics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Generate Prometheus metrics during block sync

4 participants