PR: #32 feat/07-block-listener
File: crates/charon-scanner/src/listener.rs — BlockListener::run_once, inside block drain loop
Problem — log level
info!(
chain = %self.name,
block = number,
timestamp = timestamp,
"new block"
);
BSC produces block every ~3s. One chain = 28,800 INFO lines per day per deploy. In structured-log pipeline (Loki / CloudWatch / Datadog) this inflates ingestion cost and buries actionable warnings. Correct level for per-block heartbeat is debug!.
Problem — missing metrics
run_once and run have no metrics::counter! instrumentation. README and PR #50 scope require Prometheus counters:
charon_listener_connects_total{chain} — incremented at top of each run_once
charon_listener_disconnects_total{chain} — incremented when run_once returns Err
charon_blocks_received_total{chain} — incremented per block header forwarded
Without these, operators cannot alert on stalled listener or measure block ingestion rate from Grafana.
Fix
- Change
info! inside drain loop to debug!.
- Keep existing
info! on subscription-established and warn! on error — those levels correct.
- Add
metrics::counter! calls at three sites listed.
PR: #32 feat/07-block-listener
File: crates/charon-scanner/src/listener.rs —
BlockListener::run_once, inside block drain loopProblem — log level
BSC produces block every ~3s. One chain = 28,800 INFO lines per day per deploy. In structured-log pipeline (Loki / CloudWatch / Datadog) this inflates ingestion cost and buries actionable warnings. Correct level for per-block heartbeat is
debug!.Problem — missing metrics
run_onceandrunhave nometrics::counter!instrumentation. README and PR #50 scope require Prometheus counters:charon_listener_connects_total{chain}— incremented at top of eachrun_oncecharon_listener_disconnects_total{chain}— incremented whenrun_oncereturnsErrcharon_blocks_received_total{chain}— incremented per block header forwardedWithout these, operators cannot alert on stalled listener or measure block ingestion rate from Grafana.
Fix
info!inside drain loop todebug!.info!on subscription-established andwarn!on error — those levels correct.metrics::counter!calls at three sites listed.