Skip to content

EVM-38: EvmMicrometerMetricsRecorder #152

@Puneethkumarck

Description

@Puneethkumarck

Context

The EVM metrics recorder exposes Prometheus counters for observability of the indexer pipeline. It follows the same MetricsRecorder pattern used by the Solana indexer, providing a recordBatch convenience method that increments multiple counters from a single EvmBatchResult.

Specification

  • Layer: Infrastructure (infrastructure/metrics/EvmMicrometerMetricsRecorder.java)
  • 12 Prometheus counters:
    • evm_blocks_processed — blocks successfully processed
    • evm_tx_received — transactions received from stream
    • evm_tx_written — transactions written to DB
    • evm_tx_failed — failed transactions recorded
    • evm_transfers_native — large native transfers detected
    • evm_transfers_token — ERC-20 token transfers detected
    • evm_accounts_written — accounts upserted
    • evm_reorgs_detected — chain reorganizations detected
    • evm_batches — batch flush operations
    • evm_rpc_calls — JSON-RPC calls made
    • evm_rpc_errors — JSON-RPC errors encountered
    • evm_blocks_backfilled — blocks fetched during gap backfill
  • Convenience method: recordBatch(EvmBatchResult result) — increments evm_tx_written, evm_tx_failed, evm_transfers_native, evm_transfers_token, and evm_batches from the batch result fields
  • Individual record methods for counters not covered by batch result (blocks, reorgs, rpc calls, etc.)

Acceptance Criteria

  • All counters registered with Micrometer MeterRegistry
  • recordBatch increments written, failed, native transfers, token transfers, and batches counters
  • Individual record methods increment their respective counters
  • Unit tests use SimpleMeterRegistry to verify counter values after recording

Dependencies

  • EVM-13: EvmBatchResult domain model (input to recordBatch)

References

Metadata

Metadata

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions