Skip to content

Conversation

@snowp
Copy link
Contributor

@snowp snowp commented Jan 6, 2026

Summary

  • Add metrics for tracking KV store health and operational visibility
  • Add 13 new tests covering all metric emission scenarios

Metrics Added

Metric Labels Description
kv:capacity_exceeded recoverable=true/false Capacity limit events
kv:data_loss severity=partial/total Data loss during recovery
kv:journal_open result=success/failure Journal open outcomes
kv:journal_rotation result=success/failure Rotation outcomes
kv:journal_sync result=success/failure Sync outcomes
kv:compression result=success/failure Archive compression
kv:rotation_duration_s (histogram) Rotation timing

Test Coverage

New test file versioned_kv_store_metrics_test.rs with 13 tests covering:

  • Recoverable vs unrecoverable capacity exceeded scenarios
  • Journal open success (new and existing journals) and failure (corrupted)
  • Data loss detection (partial corruption and total corruption)
  • Rotation success (manual and automatic via high water mark)
  • Sync success
  • Compression success during rotation
  • Histogram population

All 92 tests pass, clippy clean.

Add metrics for tracking KV store health:
- capacity_exceeded (recoverable/unrecoverable)
- data_loss (partial/total severity)
- journal_open/rotation/sync (success/failure)
- compression (success/failure)
- rotation_duration_s histogram

Add 13 new tests covering all metric scenarios including
corruption recovery and capacity handling edge cases.
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