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

Expose lag as prometheus metric #379

Merged
merged 1 commit into from
Aug 10, 2023
Merged

Expose lag as prometheus metric #379

merged 1 commit into from
Aug 10, 2023

Conversation

benbjohnson
Copy link
Collaborator

This pull request adds the litefs_lag_seconds gauge and returns the lag behind the primary in seconds. This metrics is server-wide as opposed to the per-db litefs_db_latency_seconds metric.

It also accounts for heartbeats so replicas that don't receive transactions for more than a second will still have their lag updated. When no transactions are received, a lag of ~1s is normal as that is the heartbeat interval.

The litefs_db_latency_seconds metric has been renamed to litefs_db_lag_seconds for consistency as well.

Copy link
Contributor

@tvdfly tvdfly left a comment

Choose a reason for hiding this comment

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

LGTM, thx!

@benbjohnson benbjohnson merged commit 53cb40b into main Aug 10, 2023
16 checks passed
@benbjohnson benbjohnson deleted the lag-metric branch August 10, 2023 20:37
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