Skip to content

[P2] Add self-observability metrics (queue length, in-flight, WS reconnects, last header) #45

Closed

Description

@auricom

Priority: P2 (feature) · Effort: S

Problem

Today you can't tell from metrics alone that the verifier is falling behind or that the WebSocket keeps reconnecting.

Proposed metrics

  • ev_metrics_verifier_queue_length (gauge)
  • ev_metrics_verifier_inflight_blocks (gauge)
  • ev_metrics_ws_reconnects_total (counter)
  • ev_metrics_last_header_received_timestamp (gauge, unix seconds)

Pros / Cons

  • ✅ Lets you alert on the monitor's own health.
  • ⚠️ 4 more series.

Acceptance criteria

  • Tests in pkg/metrics/metrics_test.go.
  • README updated (per CLAUDE.md).

Activity

  1. auricom commented on Oct 20, 2026

    @auricom
    CollaboratorAuthor

    Scope update after #58: the verifier now uses jobs and timer-based retries (time.AfterFunc) and backfills after reconnects. Suggested metric semantics:

    • verifier_queue_length: len(blockQueue)
    • verifier_inflight_blocks: blocks between first attempt and verified or exhausted, including those waiting on a retry timer (count up and down in verifyBlock)
    • ws_reconnects_total: increment where reconnectSubscription returns a new subscription
    • also consider verifier_backfilled_blocks_total and verifier_backfill_dropped_total (the 1000-block cap in backfill)

    The verifier tests use fakes, so these can be unit-tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions