Skip to content

Implement Custom Metrics Cardinality Guard #403

Description

@maugauwi-hash

Labels: bug, observability
Priority: Medium
Estimated Time: 1.5 hours

Description:
backend/src/custom_metrics.rs allows registering custom metrics, but unbounded label cardinality (e.g., using a user ID as a label) could blow up the metrics backend's memory and cost.

Tasks:

  • Add a cardinality limit per metric label
  • Reject or drop label values beyond the limit with a warning log
  • Add tests for cardinality limit enforcement
  • Document safe labeling practices in docs/custom-dashboards.md

Activity

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingobservability

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions