메트릭

지원 버전: Istio 1.28 마지막 업데이트: 2026년 2월 19일

Istio는 서비스 메시의 모든 트래픽에 대한 메트릭을 자동으로 수집하고, Prometheus, OpenTelemetry 등 다양한 백엔드와 통합하여 포괄적인 관찰성을 제공합니다.

목차

메트릭 개요

Golden Signals

Istio는 Google의 SRE 원칙에 따른 Golden Signals를 자동으로 수집합니다:

  1. Latency (지연시간): 요청 처리 시간

  2. Traffic (트래픽): 시스템 처리량 (RPS, Bandwidth)

  3. Errors (에러): 실패율과 에러 유형

  4. Saturation (포화도): 리소스 사용률

메트릭 수집 아키텍처

spinner

Istio 표준 메트릭

HTTP/gRPC 메트릭

Istio는 모든 HTTP/gRPC 트래픽에 대해 다음 메트릭을 생성합니다:

istio_requests_total

타입: Counter 설명: 처리된 총 요청 수

주요 레이블:

  • response_code: HTTP 상태 코드 (200, 404, 500, etc.)

  • response_flags: Envoy 응답 플래그

    • UH: Upstream connection failure

    • UF: Upstream connection failure

    • UR: Upstream request timeout

    • DC: Downstream connection termination

    • LR: Local reset

    • URX: Rejected by circuit breaker

  • connection_security_policy: mTLS 여부 (mutual_tls, none)

istio_request_duration_milliseconds

타입: Histogram 설명: 요청 처리 시간 (밀리초)

istio_request_bytes

타입: Histogram 설명: 요청 본문 크기 (바이트)

istio_response_bytes

타입: Histogram 설명: 응답 본문 크기 (바이트)

TCP 메트릭

istio_tcp_connections_opened_total

타입: Counter 설명: 열린 TCP 연결 수

istio_tcp_connections_closed_total

타입: Counter 설명: 닫힌 TCP 연결 수

istio_tcp_sent_bytes_total

타입: Counter 설명: 전송한 바이트 수

istio_tcp_received_bytes_total

타입: Counter 설명: 수신한 바이트 수

Circuit Breaker 메트릭

Circuit Breaker와 Outlier Detection 동작을 모니터링하기 위한 핵심 메트릭입니다.

주요 Circuit Breaker 메트릭

1. Upstream Connection Pool Overflow

의미: maxConnections 제한 초과

2. Circuit Breaker Open (Upstream Request Rejected)

3. Pending Requests Overflow

의미: http1MaxPendingRequests 또는 http2MaxRequests 초과

4. Retry Budget Exhausted

5. Response Flags로 Circuit Breaker 감지

Response Flags 상세:

  • UO: Upstream overflow (circuit breaker open)

  • URX: Rejected by circuit breaker

  • UF: Upstream connection failure

  • UH: No healthy upstream

Circuit Breaker 모니터링 대시보드 쿼리

Circuit Breaker 알림 규칙

Resilience 메트릭

Outlier Detection 메트릭

1. Ejected Hosts

2. Ejection Events

제거 유형별:

Retry 메트릭

Timeout 메트릭

OpenTelemetry 통합

OpenTelemetry Collector 설정

Istio는 OpenTelemetry 프로토콜을 통해 메트릭을 내보낼 수 있습니다.

1. MeshConfig 설정

2. Telemetry API로 OpenTelemetry 활성화

3. OpenTelemetry Collector 배포

4. Prometheus ServiceMonitor 설정

OpenTelemetry 메트릭 검증

Prometheus 통합

Prometheus 설정

1. Prometheus ConfigMap

2. ServiceMonitor로 자동 스크래핑

Prometheus 쿼리 최적화

Telemetry API를 통한 커스터마이징

메트릭 커스터마이징

1. 특정 메트릭만 활성화

2. 커스텀 레이블 추가

3. 네임스페이스별 메트릭 설정

4. 메트릭 비활성화로 성능 향상

실전 메트릭 쿼리

Golden Signals 대시보드

1. Latency (지연시간)

2. Traffic (트래픽)

3. Errors (에러)

4. Saturation (포화도)

mTLS 모니터링

서비스 메시 health 대시보드

메트릭 최적화

고카디널리티 문제 해결

1. 불필요한 레이블 제거

2. 레이블 값 정규화

메트릭 샘플링

Envoy 통계 샘플링으로 메모리 및 CPU 사용량 감소:

Prometheus 성능 튜닝

문제 해결

메트릭이 수집되지 않을 때

1. Envoy 메트릭 엔드포인트 확인

2. Prometheus가 타겟을 발견했는지 확인

3. Telemetry API 설정 검증

메트릭 레이블이 누락되었을 때

메트릭 cardinality 폭발

Circuit Breaker 메트릭이 보이지 않을 때

참고 자료

마지막 업데이트