World map

 

BM: Baca dalam Bahasa Melayu

World O2: Counters

Labels and cardinality

You will learn: how labels split one metric into many series, how to filter them, and which labels to avoid.

Checked with Prometheus 3 on 1 Nov 2026

The problem

You add the order number as a label: order_id. 10,000 orders today. How many series does Prometheus keep?

Pick one answer.

Watch

Tap every nasi lemak series.

0 of 2 found

A label: A sticky note on a series, like stall="cendol". Every new combination makes a new series. is a sticky note on a series. One name, five sets of notes: five time series: One metric name plus one set of labels: a line of values over time..

Try it

Show only the SS15 outlet. Put a label filter in curly brackets.

Add {outlet="ss15"} right after the name, then Run.

Metrics in this data (tap to add):

Time 0 is when the data starts. The query looks back from the eval time.

Predict

3 stalls, 2 outlets, and a new label for 4 ways to pay. At most, how many series?

Pick one answer.

Try it

Is it a safe label? Swipe right for safe.

Swipe right for good, left for needs work. Or use the buttons.

1 / 6stall="cendol"
stall="cendol"

Check

How many series does kedai_orders_total make? Count them with count().

Wrap the name in count( ), then Run.

Metrics in this data (tap to add):

Time 0 is when the data starts. The query looks back from the eval time.

You did it!

You can now filter by label and keep the series count small.

Go deeper (optional)

The number of series is called cardinality: How many series a metric makes. Labels like user id or order id make far too many.. Too many series fill memory and slow every query. Keep ids, emails and full URLs in logs or traces. Four matchers: =, !=, =~ and !~.

Real mission

  1. docker compose up -d
  2. docker compose down

0 of 4 steps done · Your ticks are saved.