Skip to content

Improve logging granularity for batch and query processing - #1348

Merged
DZakh merged 15 commits into
mainfrom
claude/sharp-gauss-p9oi1f
Jun 25, 2026
Merged

Improve logging granularity for batch and query processing#1348
DZakh merged 15 commits into
mainfrom
claude/sharp-gauss-p9oi1f

Conversation

@DZakh

@DZakh DZakh commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

Refactors logging throughout the event processing pipeline to provide more granular, per-chain and per-partition visibility into batch and query operations. This replaces aggregated batch-level logs with individual chain/partition logs that fire at more appropriate points in the processing lifecycle.

Key Changes

  • EventProcessing.res:

    • Modified registerProcessEventBatchMetrics to accept the batch and log per-chain progress (chainId, batchSize, progressBlockNumber) instead of aggregated totals
    • Updated processEventBatch to log per-chain "Started processing" messages instead of a single aggregated batch start log
  • ChainFetching.res:

    • Added per-partition tracking during query dispatch to accumulate results across all queries in a tick
    • Logs a single "Finished querying" message with all partition results once all dispatched queries complete, rather than logging per-query
  • SourceManager.res:

    • Introduced waitingLogged flag to deduplicate "waiting for new blocks" traces, firing once per contiguous wait period instead of on every polling epoch
    • Consolidated conditional logging into a single trace call that handles both reduced polling and normal cases
    • Removed redundant "Fetched block range from server" log from executeQuery (now logged at a higher level in ChainFetching)
  • CrossChainState.res:

    • Added "Started querying" log with per-partition details (fromBlock, targetBlock) when queries are admitted for a chain

Notable Details

  • Logging now uses per-chain/partition granularity to better correlate with actual work units
  • Deduplication of repetitive "waiting for new blocks" logs reduces noise during backfill periods
  • Query result logging consolidated to fire once per tick rather than per-query, improving readability of logs during high-volume query scenarios

https://claude.ai/code/session_01LQW127Bx6F25cnkAKryHJ4

claude added 15 commits June 23, 2026 13:48
Per-query and per-batch trace logs scaled with partition/query count,
producing a large volume of low-signal lines on high-address indexers.

- Aggregate per-query fetch traces into one "Started fetching queries"
  line per cross-chain tick and one "Fetched block ranges from server"
  line per chain dispatch, replacing the per-query "Fetched block range
  from server" line (and its heavy stats payload).
- Merge the per-batch "Started/Finished processing batch" pair into a
  single "Processed batch" line.
- Dedupe the "waiting for new blocks" trace so it fires once per
  contiguous wait period instead of on every re-entering epoch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQW127Bx6F25cnkAKryHJ4
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQW127Bx6F25cnkAKryHJ4
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQW127Bx6F25cnkAKryHJ4
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQW127Bx6F25cnkAKryHJ4
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQW127Bx6F25cnkAKryHJ4
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQW127Bx6F25cnkAKryHJ4
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQW127Bx6F25cnkAKryHJ4
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQW127Bx6F25cnkAKryHJ4
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQW127Bx6F25cnkAKryHJ4
Gate the finished querying log on all dispatched partitions being fetched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQW127Bx6F25cnkAKryHJ4
…arted processing

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQW127Bx6F25cnkAKryHJ4
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQW127Bx6F25cnkAKryHJ4
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQW127Bx6F25cnkAKryHJ4
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@DZakh, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 6 minutes and 41 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f25b8b98-27db-4fd4-9265-3540d9b0cfb2

📥 Commits

Reviewing files that changed from the base of the PR and between 9fe5953 and ed8e12c.

📒 Files selected for processing (4)
  • packages/envio/src/ChainFetching.res
  • packages/envio/src/CrossChainState.res
  • packages/envio/src/EventProcessing.res
  • packages/envio/src/sources/SourceManager.res

Comment @coderabbitai help to get the list of available commands.

@DZakh
DZakh merged commit 6fd80dd into main Jun 25, 2026
7 of 8 checks passed
@DZakh
DZakh deleted the claude/sharp-gauss-p9oi1f branch June 25, 2026 12:43
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.

2 participants