prometheus / prometheus/docs

Prometheus Docs Recommend Bizarrely Low Cardinality

Open
#2,291 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
717
Forks
1.2k
Avg merge
3d 15h
Merged PRs (30d)
19

Description

Doc: https://prometheus.io/docs/practices/instrumentation/

This documentation recommends keeping cardinality low, which is good advice, but its definition of "low" is bizarre.

As a general guideline, try to keep the cardinality of your metrics below 10, and for metrics that exceed that, aim to limit them to a handful across your whole system. The vast majority of your metrics should have no labels.

If you have a metric that has a cardinality over 100 or the potential to grow that large, investigate alternate solutions such as reducing the number of dimensions or moving the analysis away from monitoring and to a general-purpose processing system.

I have never seen a metric with cardinality below 10 in the wild, A simple latency metric that uses default prometheus bucketing and runs on 9 hosts will hit 100. This gives new engineers a very incorrect idea of what prometheus is capable of and I think it should be changed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the instrumentation documentation page linked in the issue and review the quoted cardinality guidance in the context of Prometheus metrics and labels. Done means the documentation no longer gives a misleading definition of low cardinality and accurately communicates practical limits for new engineers.

Written by the indexing model from the issue text.

Assessment

Tech stack
prometheus
Domain
documentation, observability-sre
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.