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.
The
src/metrics.rsmodule 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.rsdefines metric collectors but is not used by any caller.src/stellar.rsdoes not track verification latency or failure modes.src/cache.rsdoes not emit hit/miss/expiry metrics.src/config.rshas 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.rssrc/stellar.rssrc/cache.rssrc/config.rssrc/rate_limit.rssrc/event.rssrc/hash_validator.rsREADME.mdAcceptance criteria: