System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) · 강의

지표 유형 설명

게이지, 카운터, 히스토그램, 요약이라는 기본 지표 유형을 이해합니다. 효과적인 모니터링을 위해 각 유형을 언제 어떻게 적용하는지 배웁니다.

레슨 1/411개 단계

지표 유형 설명은(는) CoddyKit의 무료 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 강의입니다. 이것은 4개 중 1번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

What are Metric Types?

Welcome to "Types of Metrics Explained"! In observability, metrics are crucial for understanding your system's health and performance.

But not all numbers are the same! Categorizing metrics helps us collect, store, and analyze them effectively.

We'll explore the four fundamental types: Gauges, Counters, Histograms, and Summaries.

Gauges: Snapshot of Now

A Gauge represents a single numerical value that can go up and down over time. Think of it like a car's speedometer or a thermometer.

Gauges are perfect for capturing the current state of a system at a specific moment.

  • Use for: Current CPU usage, memory consumption, queue size, temperature.
  • Nature: Point-in-time value.

Gauge Code Example

Here's a simple Java example simulating a gauge tracking current CPU utilization. Notice how its value can change freely.

public class Main {
  public static void main(String[] args) {
    double cpuUsage = 0.5; // 50% CPU
    System.out.println("Current CPU Usage: " + cpuUsage);

    // Later, CPU usage might change
    cpuUsage = 0.8; // 80% CPU
    System.out.println("Updated CPU Usage: " + cpuUsage);

    cpuUsage = 0.3; // 30% CPU
    System.out.println("Further Updated CPU Usage: " + cpuUsage);
  }
}

Counters: Always Increasing

A Counter is a cumulative metric that only ever increases. It represents a total count of something that has occurred since the system started.

It can reset to zero only when the monitored system restarts.

  • Use for: Total requests served, errors encountered, bytes sent, login attempts.
  • Nature: Monotonically increasing total.

Counter Code Example

This Java example demonstrates a counter for total requests. Each 'request' simply increments the counter.

public class Main {
  private static long totalRequests = 0;

  public static void handleRequest() {
    totalRequests++;
    System.out.println("Requests handled: " + totalRequests);
  }

  public static void main(String[] args) {
    System.out.println("Initial requests: " + totalRequests);
    handleRequest(); // First request
    handleRequest(); // Second request
    // ... more requests later
    handleRequest(); // Third request
  }
}

Histograms: Value Distributions

Histograms sample observations (like request durations or response sizes) and count them in configurable buckets.

They give you insight into the distribution of values, not just the average. This is vital for understanding latency and performance.

  • Benefit: You can calculate percentiles (e.g., 99th percentile latency) on the server side.
  • Use for: Request latency, response sizes, data transfer rates.

Summaries: Pre-calculated Percentiles

Summaries are similar to histograms but often pre-calculate configurable quantiles (like p99, p95, p50) on the client side.

Instead of sending raw data, the client library sends pre-computed statistics (sum, count, and quantiles) to the monitoring system.

  • Benefit: Less data sent over the network, but less flexible for custom percentile calculations later.
  • Use for: Latency measurements where specific percentiles are known to be needed.

Histograms vs. Summaries

Both Histograms and Summaries track distributions, but they differ in where calculations happen:

  • Histograms: Send raw data (counts in buckets). Percentiles are calculated on the server. More flexible for ad-hoc analysis.
  • Summaries: Calculate percentiles on the client and send pre-computed results. More resource-efficient if you know exactly which percentiles you need.

For most modern systems, Histograms are generally preferred due to their flexibility.

Picking the Best Metric Type

Choosing the right metric type is key for effective monitoring:

  • Gauges: For current values that can go up/down (e.g., disk usage, active users).
  • Counters: For cumulative totals that only increase (e.g., total errors, processed items).
  • Histograms: For distributions of values where you need server-side percentile calculation and flexibility (e.g., request durations).
  • Summaries: For distributions where client-side pre-calculated percentiles are sufficient and network efficiency is critical (less common than histograms now).

Metric Type Challenge

Your application processes user orders. You want to track the total number of orders placed since the application started, and also the current number of items in the processing queue.

Key Takeaways on Metrics

Great job! You've now learned about the four fundamental metric types:

  • Gauges: For current, fluctuating values.
  • Counters: For cumulative, ever-increasing totals.
  • Histograms: For understanding the distribution of values and calculating percentiles server-side.
  • Summaries: For pre-calculated percentiles client-side.

Understanding these types helps you choose the right tool for the right job, leading to more insightful monitoring and faster debugging!

무료로 시작

AI 튜터와 함께 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)을(를) 배우세요 — 무료

브라우저에서 실제 코드를 작성하고 실행하며, 24/7 AI 튜터로부터 즉각적인 도움을 받고, 웹이나 앱에서 중단한 부분부터 계속 학습하세요.

코스
12
레슨
48

자주 묻는 질문

“지표 유형 설명” 강의는 무료인가요?

네 — “지표 유형 설명” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 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개 중 1번째 강의입니다.

“지표 유형 설명” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. 지표 유형 설명
  2. 지표 수집 전략
  3. 지표 시각화와 알림
  4. 메트릭 카디널리티와 라벨링 모범 사례
← System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry)(으)로 돌아가기