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: cursor metrics #4892

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Mantas-M
Copy link
Contributor

Description

Adds metrics to ForwardBackward cursor in order to be able to monitor sync progress more effectively.

Introduced metrics

  • cursor_current_block: Which block is the forward and backward cursor indexing currently for each event
    Cursor Current Block BSC
    Example above shows all event average

  • cursor_current_sequence: Which sequence is the cursor currently on for a specific event
    Cursor Current Sequence
    As in the graph for Base above, we can see that the Forward cursor only begins showing data if there are new events to index since agent launch

  • cursor_max_sequence: The max sequence the cursor can reach

image

Related issues

Backward compatibility

Yes

Testing

Manual

Copy link

changeset-bot bot commented Nov 24, 2024

⚠️ No Changeset found

Latest commit: b44741e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Mantas-M
Copy link
Contributor Author

Mantas-M commented Nov 27, 2024

Read the issue again and I thought to refactor the metrics to be cursor generic due to this requirement set by @daniel-savu
for all event types (regardless if sequenced or not): the block number the cursor(s) are currently at

Initially seems like it would be not necessary due to the contract_sync_block_height metric doing mostly the same thing:

image

But this makes it cleaner in my opinion and when/if the internal Grafana dashboards would be migrated to the new metric, contract_sync_block_height could be removed entirely.

Now with the CursorMetrics being passed in to both the RateLimitedContractSyncCursor and the ForwardBackwardSequenceAwareSyncCursor we get a more verbose group of metrics from both sequence aware and non sequence aware event indexing cursor block heights:

image

Additionally, since the implementation of name on the Indexable trait, we could technically remove the label strings passed into the sync function making it a bit nicer and keeping all the hardcoded strings on the Indexable trait implementation.

image

@Mantas-M Mantas-M changed the title feat: forward-backward cursor metrics feat: cursor metrics Nov 28, 2024
@Mantas-M Mantas-M requested a review from ameten December 12, 2024 16:15
Copy link
Contributor

@daniel-savu daniel-savu left a comment

Choose a reason for hiding this comment

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

mostly lgtm but will leave the final green light to @ameten!

@Mantas-M
Copy link
Contributor Author

Mantas-M commented Dec 16, 2024

Just a note about the failing E2E test @ameten

Seems like a dependency package called home of a crate used by sealevel (spl-token-cli) just got a fresh update requiring a higher rustc version.
image

Not related to this PR, but should be pinned down to the previous version to avoid future issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

Expose metrics for sequence indexing cursor progress
3 participants