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

feat: add sync status and time from last indexed block #171

Merged
merged 2 commits into from
Dec 7, 2024

Conversation

anxolin
Copy link
Contributor

@anxolin anxolin commented Dec 7, 2024

Description

One of the things is super hard to monitor in Watch Tower is the sync status.

The problem

Syncing from the origin of times (deployment of composable cow), can take a while. Currently, Its super hard to see which instances of watch-tower are in sync.

Further more, if there's a crash, or you restart a pod, it will enter in sync mode (to catch up). There could be issues of not catching up fast enough. Its very hard to see that your watch-tower is lagging behind.

Additions in this PR

Sync status metric

Now, there's a new prometheus metric for the SYNC status.

# HELP watch_tower_sync_status Sync status of watch rower. 1 if in sync, 0 otherwise
# TYPE watch_tower_sync_status gauge
watch_tower_sync_status{chain_id="1"} 0

Last block

Once we know we are SYNCING, its hard to tell how far we are from the tip of the blockchain.

We have some metric to know the last indexed block, but this is hard to use to get a quick idea if we are catching up. With the block you see a growing number, that then you need to check how far from the tip is in a block explorer.

This PR creates a new metric with the timestamp of the latest block. This way, we can present the distance to NOW, to show how far we are from a full sync. Also, as we see the updates in the dashboard real time, we can see the rate in which this relative time decreases.

# HELP watch_tower_block_timestamp Block timestamp of the last processed block
# TYPE watch_tower_block_timestamp gauge
watch_tower_block_timestamp{chain_id="1"} 1722003767

@anxolin anxolin requested a review from a team December 7, 2024 13:46
@anxolin anxolin changed the title feat: add sync status feat: add sync status and time from last indexed block Dec 7, 2024
@anxolin
Copy link
Contributor Author

anxolin commented Dec 7, 2024

Please @cowprotocol/frontend , i will need a review on this, but merging cause I need to test this in DEVELOPMENT asap

@anxolin anxolin merged commit 03bf9fd into main Dec 7, 2024
4 checks passed
@anxolin anxolin deleted the add-sync-status-metrics branch December 7, 2024 13:50
@github-actions github-actions bot locked and limited conversation to collaborators Dec 7, 2024
@anxolin
Copy link
Contributor Author

anxolin commented Dec 7, 2024

These are the additions to the grafana charts

image

You can filter also by chain and env:

image

Copy link
Contributor

@alfetopito alfetopito left a comment

Choose a reason for hiding this comment

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

👍

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