Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Add pivot block metrics #1537

Merged
merged 2 commits into from
Jun 7, 2019
Merged

Add pivot block metrics #1537

merged 2 commits into from
Jun 7, 2019

Conversation

ajsutton
Copy link
Contributor

@ajsutton ajsutton commented Jun 7, 2019

PR description

Add two metrics:

  • Current pivot block number (allowing monitoring dashboards to report how much further the fast sync chain download has to go)
  • Number of times a pivot block has been selected (allowing you to detect when a world state download stalled and a new pivot block was required).

@@ -44,6 +47,8 @@
private final EthContext ethContext;
private final SyncState syncState;
private final MetricsSystem metricsSystem;
private final Counter pivotBlockSelectionCounter;
private final AtomicLong pivotBlockGauge = new AtomicLong(0);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually want a gauge which I can set the value for instead of having to pass in a supplier. Prometheus metrics support this (in fact it's all it supports natively) but not sure if we should complicate the metrics API to expose that or not.

Normally the pivot block number is only stored in FastSyncState which is immutable and just passed as a method argument so we can't create a gauge that reads the value directly from there.

Copy link
Contributor

Choose a reason for hiding this comment

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

What would be nicer is if we could de-register the gauge or make it optional sensitive so the value doesn't report when we are not fast-syncing. If I ever get back to my labeled gauge work I'll try to remember that as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very true.

@@ -44,6 +47,8 @@
private final EthContext ethContext;
private final SyncState syncState;
private final MetricsSystem metricsSystem;
private final Counter pivotBlockSelectionCounter;
private final AtomicLong pivotBlockGauge = new AtomicLong(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

What would be nicer is if we could de-register the gauge or make it optional sensitive so the value doesn't report when we are not fast-syncing. If I ever get back to my labeled gauge work I'll try to remember that as well.

@ajsutton ajsutton merged commit 741ebfc into PegaSysEng:master Jun 7, 2019
@ajsutton ajsutton deleted the pivot-metrics branch June 7, 2019 03:03
iikirilov pushed a commit to Puneetha17/pantheon that referenced this pull request Jun 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants