Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add poller last triggered block metric and improve block number handl…
…ing (#86) ### 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.
- Loading branch information