Skip to content

Add faucet-usage metrics event so ops can monitor testnet consumption #820

Description

@thlpkee20-wq

Description

Expose faucet_metrics_v1 events that emit periodically summarizing total dispensed, unique addresses served, and recent cooldown rejects. Enables ops dashboards.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Relevant code: src/test_faucet_seed.rs, indexer/
  • Metrics must be idempotent per emission window

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/faucet-metrics-event
  • Implement changes
    • Add faucet_metrics_v1 topic emitter
    • Emit on schedule keyed to ledger time
    • Add indexer fixture
  • Validate security and correctness assumptions

Test and commit

  • Run tests
    • cargo test --all
  • Cover edge cases
    • Two emissions within the same window (dedup)
  • Include test output and security notes

Example commit message

feat: emit faucet_metrics_v1 events

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions