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

Add poller last triggered block metric and improve block number handling #86

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

iuwqyir
Copy link
Collaborator

@iuwqyir iuwqyir commented Oct 2, 2024

TL;DR

Added a new metric for the last triggered block in the poller and improved block number tracking.
Removed the division by 10, because this should be configured in Grafana settings to not display scientific notation

What changed?

  • Introduced a new Prometheus gauge metric poller_last_triggered_block to track the last block number that triggered the poller.
  • Updated the Poller.Start() method to set the new metric with the end block number of each polling cycle.
  • Modified the Worker.Run() method to use Float64() instead of dividing by 10 when setting the LastFetchedBlock metric, addressing a TODO and improving precision.

How to test?

  1. Run the application and ensure it starts without errors.
  2. Check Prometheus metrics to verify the new poller_last_triggered_block metric is present and updating correctly.
  3. Confirm that the LastFetchedBlock metric is now reporting accurate values without scientific notation.

Why make this change?

  • The new poller_last_triggered_block metric provides better visibility into the poller's progress, allowing for more accurate monitoring and debugging.
  • Updating the LastFetchedBlock metric calculation improves precision and removes the need for the temporary division workaround, enhancing the overall reliability of the metrics system.

Copy link
Collaborator Author

iuwqyir commented Oct 2, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @iuwqyir and the rest of your teammates on Graphite Graphite

@iuwqyir iuwqyir changed the title create separate metric for last polled block Add poller last triggered block metric and improve block number handling Oct 2, 2024
@iuwqyir iuwqyir requested a review from AmineAfia October 2, 2024 14:58
@iuwqyir iuwqyir marked this pull request as ready for review October 2, 2024 14:58
@iuwqyir iuwqyir merged commit 23edc5e into main Oct 4, 2024
4 checks passed
@iuwqyir iuwqyir deleted the 10-02-create_separate_metric_for_last_polled_block branch October 4, 2024 17:41
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.

2 participants