← All Articles

Time-Series Cardinality Budgeting for Prometheus

A governance model for labels and metric families that keeps Prometheus fast during incidents while preserving useful debugging signals.

Cardinality blowups are predictable if you do not enforce label budgets.

Budget by Metric Family

Assign a max active-series target for each service and block merges that exceed policy.

metric_relabel_configs:
  - source_labels: [path]
    regex: "/users/[0-9]+"
    target_label: path
    replacement: "/users/:id"

Anti-Patterns

  • Raw URL labels.
  • User IDs in counters.
  • Request IDs in histograms.

Metrics should summarize systems, not mirror event logs.

Next ArticleClickHouse Materialized View Pipelines for Product AnalyticsData Engineering · 14 min read