feat(shadow_metrics): Remove shadow metrics emission - #4732
Conversation
🟡 Heimdall Review Status
|
|
✅ All benchmarks green — 14 within ±2% (deterministic instruction counts). View run Benchmark details (14)
|
Review SummaryClean removal of the shadow-metrics polling reader and Prometheus emission pipeline. The deletion is thorough: types ( Findings (nits — all in unchanged lines, so inline comments could not be posted):
No correctness, safety, or concurrency issues found. Not block-production-sensitive (shadow-metrics is a read-only observability service). |
… cursor Dismantle the shadow-metrics background pipeline, leaving the crate as the read-only block-explorer API over persisted shadow blocks. Metric emission: delete the ShadowMetrics definitions and all recording (gas/tx/inversion histograms, block counters, backlog gauges, poll-error counters); drop the base-metrics dependency, the optional metrics dependency, and the metrics feature. Reader + cursor: the reader existed only to poll shadow_blocks via a persisted cursor and emit metrics, so both are now removed. - shadow-indexer-db: drop ShadowBlockCursor, ShadowMetricsCursorRepo, ShadowBlockRepo::list_reorged_since/max_cursor, ShadowBlockRow::cursor. - shadow-metrics: delete ShadowMetricsReader; readiness now only checks that shadow_blocks is readable (drop the shadow_metrics_cursor probe); remove the now-unused tokio dependency. - bin: drop reader spawning, liveness tracking, and poll-interval/max-rows args; /readyz now checks only schema readiness. The Prometheus metrics initializer is left in place. - system tests: keep the DB reconciliation tests (renamed to shadow_blocks_reconciliation.rs), remove the reader/cursor tests, and drop the now-unused base-shadow-metrics dev-dependency. The shadow_metrics_cursor table and its migrations are left in place; no code references them. Co-authored-by: OpenCode <opencode-noreply@coinbase.com>
f63ed1c to
a0f1cb5
Compare
Review SummaryClean removal PR. The deleted code ( Minor finding (not in diff, so no inline comment possible)Stale doc comment in PR description inconsistencyThe PR description says "The No correctness, safety, concurrency, or performance issues found. This PR does not touch block-production-sensitive paths. |
Summary
Dismantles the shadow-metrics background pipeline, leaving the crate as the read-only block-explorer API over persisted shadow blocks. Removes all Prometheus metric emission and the polling reader together with its cursor infrastructure (the reader existed only to poll
shadow_blocksvia a cursor and emit metrics).Changes
shadow-metrics: DeleteShadowMetricsand all metric recording; deleteShadowMetricsReader./readyznow only checks thatshadow_blocksis readable. Drop thebase-metrics,metrics, andtokiodeps and themetricsfeature.shadow-indexer-db: DropShadowBlockCursor,ShadowMetricsCursorRepo,ShadowBlockRepo::{list_reorged_since, max_cursor}, andShadowBlockRow::cursor().shadow_blocks_reconciliation.rs), remove the reader/cursor tests, drop the unusedbase-shadow-metricsdev-dependency.Notes
shadow_metrics_cursortable and its migrations are intentionally left in place; no code references them.Testing
cargo clippyclean acrossbase-shadow-indexer-db,base-shadow-metrics,base-shadow-metrics-binshadow_blocks_reconciliationsystem test compiles