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(metrics) - EL status 'syncing' distance above threshold #1984

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

oleg-ssvlabs
Copy link
Contributor

Related to #1960

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.0%. Comparing base (6b27b3a) to head (6d7e9c8).
Report is 1 commits behind head on stage.

Additional details and impacted files

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@oleg-ssvlabs oleg-ssvlabs requested a review from zktaiga January 17, 2025 12:15
@oleg-ssvlabs oleg-ssvlabs merged commit 6fe1a65 into stage Jan 17, 2025
7 checks passed
@oleg-ssvlabs oleg-ssvlabs deleted the sync-status-metric-el branch January 17, 2025 12:21
syncDistance := max(sp.HighestBlock, sp.CurrentBlock) - sp.CurrentBlock

observability.RecordUint64Value(ctx, syncDistance, syncDistanceGauge.Record, metric.WithAttributes(semconv.ServerAddress(ec.nodeAddr)))

// block out of sync distance tolerance
if syncDistance > ec.syncDistanceTolerance {
recordExecutionClientStatus(ctx, statusSyncing, ec.nodeAddr)
Copy link
Contributor

Choose a reason for hiding this comment

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

@oleg-ssvlabs If the code doesn't enter this if, then syncDistanceGauge is observed twice: first with syncDistance value before the if and then with 0 in syncDistanceGauge.Record(ctx, 0, metric.WithAttributes(semconv.ServerAddress(ec.nodeAddr)))

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.

4 participants