Skip to content

Conversation

vgonkivs
Copy link
Member

Fixed BlockTime metric as it hasn't been pushed to otel before. Fixes #156

@vgonkivs vgonkivs force-pushed the fix_blockTime_metric branch from d1a2d3d to b6d0e13 Compare August 28, 2025 14:12
if !m.prevHeaderTs.IsZero() {
m.blockTime.Record(ctx, timestamp.Sub(m.prevHeaderTs).Seconds())
}
m.prevHeaderTs = time.Now()
Copy link
Member Author

Choose a reason for hiding this comment

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

The reason for setting up a time.Now() as the original idea was to calculate how much time it takes to get the header through the network after it was produced.

Copy link
Member

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

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

  • hdr_sync_actual_blockTime_ts_hist somehow camelCase sneaked in
  • "duration between creation of 2 blocks" - metric description is confusing, I don't see why two blocks? From the code we seem to track the diff between the newly received header time and the time we got the last block, but no the timestamp and an actual time.Now when header was received.

This makes wonder if really need this metric? Like what do we get from knowing the time between of new block timestamp and last factual block receiving time.

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

Successfully merging this pull request may close these issues.

bug(syncer/metrics): actual block time metric is not working in syncer
2 participants