Skip to content

Add comprehensive metrics instrumentation and monitoring #27

Description

@grantfox-oss

The src/metrics.rs module exists but is not integrated into service call paths. There are no metrics for contract invocation latency, document registration success rate, verification accuracy, cache performance, or error categories. Without production metrics, operational visibility is severely limited.

Evidence:

  • src/metrics.rs defines metric collectors but is not used by any caller.
  • src/stellar.rs does not track verification latency or failure modes.
  • src/cache.rs does not emit hit/miss/expiry metrics.
  • src/config.rs has no metrics for configuration reload or validation failures.

Impact:

Operators cannot diagnose performance bottlenecks, identify fraud patterns, or predict capacity limits. False-positive verification failures go unnoticed until customer escalation occurs.

Likely files to change:

  • src/metrics.rs
  • src/stellar.rs
  • src/cache.rs
  • src/config.rs
  • src/rate_limit.rs
  • src/event.rs
  • src/hash_validator.rs
  • README.md
  • New metrics documentation or integration tests

Acceptance criteria:

  • All major service methods emit latency, success, and error metrics.
  • Cache metrics distinguish hit, miss, expired, and serialization errors.
  • Verification metrics include success rate, Horizon latency, and retry counts.
  • Rate limiter metrics track token consumption and limit violations.
  • Event ingestion metrics report duplicates, ordering failures, and backlog size.
  • Metrics are exported to Prometheus or similar standard format.
  • README documents all available metrics and recommended alerting thresholds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions