feat(metrics): track blocks synchronized by source#3259
Conversation
Add sequencer_blocks_synchronized_total counter with source label (DA/P2P) to track how many blocks were synced from each source. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude finished @auricom's task in 1m 31s —— View job Code Review
Overall this is a clean, well-scoped addition that follows existing codebase patterns. A few issues worth addressing before merging: Issues1.
|
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 51 minutes and 20 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Use nil-safe map lookup to avoid panic when RecoverFromRaft calls trySyncNextBlockWithState with Source: "" (not in the map) - Move counter increment to after batch.Commit() so only successfully committed blocks are counted Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3259 +/- ##
==========================================
- Coverage 62.33% 62.32% -0.01%
==========================================
Files 122 122
Lines 12873 12877 +4
==========================================
+ Hits 8024 8026 +2
- Misses 3968 3970 +2
Partials 881 881
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Lowercase EventSource constant values (da/p2p/raft) for Prometheus label convention - Add SourceRaft for RecoverFromRaft path so blocks are counted - Add AllEventSources() helper to avoid duplicating source list in metrics.go - Use AllEventSources() in both PrometheusMetrics and NopMetrics init loops Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
sequencer_blocks_synchronized_totalPrometheus counter withsourcelabel (DA/P2P)Test plan
sequencer_blocks_synchronized_total{source="DA"}andsequencer_blocks_synchronized_total{source="P2P"}appear in/metrics🤖 Generated with Claude Code