메트릭 카디널리티와 라벨링 모범 사례
라벨이 카디널리티를 만드는 방식, 높은 카디널리티가 메트릭 시스템을 손상시키는 이유, 빠르고 비용 효율적으로 유지되는 라벨 체계를 설계하는 방법을 배우세요.
메트릭 카디널리티와 라벨링 모범 사례은(는) CoddyKit의 무료 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 강의입니다. 이것은 4개 중 4번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 강의에는 총 4개의 강의가 포함되어 있습니다.
이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.
What Is Cardinality?
Cardinality is the number of unique time series produced by a metric. Each distinct combination of a metric name and its label values is a separate series.
http_requests_total{method="GET"}is one series- Adding
status="200"multiplies the count
Labels Multiply
Cardinality grows by the product of the number of values per label. Three methods times five status codes times ten endpoints equals 150 series for one metric.
method: 3 values
status: 5 values
endpoint: 10 values
=> 3 * 5 * 10 = 150 seriesWhy High Cardinality Hurts
Each series consumes memory, disk, and index space. Unbounded labels can explode a single metric into millions of series, slowing queries and crashing collectors.
- Memory pressure on the TSDB
- Slow dashboards and alerts
- Higher storage cost
The Classic Anti-Pattern
Putting unbounded values like user IDs, request IDs, or full URLs into labels is the most common mistake. These create one series per unique value.
http_requests_total{user_id="48213"}
http_requests_total{request_id="a9f...c1"}Bounded vs Unbounded Labels
Good labels have a small, finite set of values.
- Bounded:
method,status_class,region - Unbounded:
user_id,session_id,email
Keep unbounded data in logs or traces, not metric labels.
Normalize Before Labeling
Reduce cardinality by bucketing values. Replace exact status codes with classes and template dynamic path segments.
status=503 -> status_class="5xx"
/users/48213 -> route="/users/:id"Estimating Series Count
Before adding a label, estimate its impact. Multiply the existing series count by the number of new label values.
existing = 200 series
new label region: 4 values
=> 200 * 4 = 800 seriesAggregation Removes Detail
When you query, aggregations like sum by (status_class) collapse series. Design labels so the dimensions you aggregate by are exactly the ones you need.
sum by (status_class) (rate(http_requests_total[5m]))Limits and Guardrails
Most TSDBs let you cap cardinality.
- Prometheus:
sample_limitper scrape - OpenTelemetry: cardinality limit on aggregations
- Alert when series counts spike
Dropping Bad Labels
If a noisy label slips in, drop or relabel it at ingestion rather than storing it.
metric_relabel_configs:
- source_labels: [user_id]
action: labeldropA Healthy Label Set
Aim for a handful of bounded labels per metric. This example stays well under a few hundred series.
orders_total{region="eu", status_class="2xx", channel="web"}Quick Check
Identify the riskiest label choice.
Recap
You learned that cardinality is the count of unique series, that labels multiply it, and that unbounded values like IDs must stay out of labels. Bucket and template values, estimate impact before adding labels, and enforce guardrails to keep metrics fast and cheap.
자주 묻는 질문
“메트릭 카디널리티와 라벨링 모범 사례” 강의는 무료인가요?
네 — “메트릭 카디널리티와 라벨링 모범 사례” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 강의 전체를 잠금 해제할 수 있습니다. System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 강의에는 총 4개의 강의가 포함되어 있습니다.
“메트릭 카디널리티와 라벨링 모범 사례”에서 뭘 배우나요?
라벨이 카디널리티를 만드는 방식, 높은 카디널리티가 메트릭 시스템을 손상시키는 이유, 빠르고 비용 효율적으로 유지되는 라벨 체계를 설계하는 방법을 배우세요. 브라우저에서 직접 실행하는 실습 코드로 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.
System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)을(를) 시작하는 데 경험이 필요한가요?
사전 경험은 필요하지 않습니다. CoddyKit의 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 4번째 강의입니다.
“메트릭 카디널리티와 라벨링 모범 사례” 강의는 얼마나 걸리나요?
대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.
이 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 강의에서 코드를 작성하고 실행할 수 있나요?
네. 모든 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.
이 강의의 모든 강의
- 지표 유형 설명
- 지표 수집 전략
- 지표 시각화와 알림
- 메트릭 카디널리티와 라벨링 모범 사례