Istio 정복하기 #10 - Observability-1 메트릭 조회
Observability는 시스템의 상태를 이해하고, 문제를 진단하며, 성능을 모니터링할 수 있는 능력을 의미한다. 즉 서비스의 상태, 성능, 오류 및 다른 지표들을 수집하고 분석이 필요하다. Istio는 이러한 Observability를 통해 마이크로서비스 구성 요소 간의 복잡한 상호 작용을 보다 쉽게 분석할 수 있도록 도와준다.
Istio는 서비스 간 요청 경로 상에 위치하여, 요청을 중재하고 필요한 메트릭을 수집하는 역할을 한다. 이 과정에서 다음과 같은 기능을 제공한다.
1. 메트릭 수집
2. 메트릭 추가
3. 분산 추적
이제 하나씩 직접 해보면서 알아보자. 만약 에드온을 실행시켰다면 모두 지우자.
Data Plane 메트릭
Istio를 실행시켰기에 사이드카 프락시가 파드들에 부착된다. 컨테이너의 요청을 보내보자.
kubectl exec -it deploy/test -c istio-proxy \-- curl localhost:15000/stats 많은 출력이 나옴 ## wasmcustom.reporter=.=destination;.;source_workload=.=istio-ingressgateway;.;source_workload_namespace=.=istio-system;.;source_principal=.=spiffe://cluster.local/ns/istio-system/sa/istio-ingressgateway-service-account;.;source_app=.=istio-ingressgateway;.;source_version=.=unknown;.;source_canonical_service=.=istio-ingressgateway;.;source_canonical_revision=.=latest;.;source_cluster=.=Kubernetes;.;destination_workload=.=webapp;.;destination_workload_namespace=.=istioinaction;.;destination_principal=.=spiffe://cluster.local/ns/istioinaction/sa/webapp;.;destination_app=.=webapp;.;destination_version=.=unknown;.;destination_service=.=webapp.istioinaction.svc.cluster.local;.;destination_service_name=.=webapp;.;destination_service_namespace=.=istioinaction;.;destination_canonical_service=.=webapp;.;destination_canonical_revision=.=latest;.;destination_cluster=.=Kubernetes;.;request_protocol=.=http;.;response_flags=.=-;.;connection_security_policy=.=mutual_tls;.;response_code=.=200;.;grpc_response_status=.=;.;istio_requests_total: 5 ~~
사실 별 설정 없이도 아래와 같이 유용한 메트릭들을 제공한다.
istio_requests_total
istio_request_bytes
istio_response_bytes
istio_request_duration
istio_request_duration_milliseconds
다른 메트릭들을 보고싶다면 여기를 방문해서 봐보자.
추가적인 매트릭을 수집하려고 한다면, IstioOperator를 사용할 수도 있지만, 워크로드 단위로 사용하는 게 좋다.
예를 들어서 test deployment를 보자.
# ~ spec: # ~ template: metadata: annotations: proxy.istio.io/config: |- proxyStatsMatcher: inclusionPrefixes: - "cluster.outbound|80||test.default"
test 서비스에 대한 아웃바운드 트래픽의 통계를 수집하게 하며, 포트 80에 대한 설정이다.으로 호출을 하고 위와 동일하게 특정 컨테이너로 들어가서 호출하면 메트릭들을 볼 수 있다.
Control Plane 메트릭
컨트롤 플레인은 전체 서비스 메쉬의 정책, 설정 및 메트릭을 관리하는 역할을 한다. 예로 sync 소요시간, 인증서 발급/교체 등이 있다. 보는 방법은 별도의 설정 없이 간단하다.
kubectl exec -it -n istio-system deploy/istiod -- curl localhost:15014/metrics --- citadel_server_csr_count 5 citadel_server_root_cert_expiry_timestamp 1.942123473e+09 citadel_server_success_cert_issuance_count 5 --- pilot_services 12 pilot_virt_services 2
인증서에 대한 메트릭과 서비스 버츄얼 서비스에 대한 지표들도 있다. 서비스와 버츄얼 서비스는 컨트롤 플레인에서 아는 개수다.
매트릭을 조회, 추가에 대해서 알아봤는데, 다음은 프로메테우스로 스크랩 하는 방법을 아아보려고 한다.
'DevOps > Kubernetes' 카테고리의 다른 글
Istio 정복하기 #9 - Circuit breaking (0) | 2025.04.04 |
---|---|
Istio 정복하기 #8 - Timeouts and retries (0) | 2025.04.02 |
Istio 정복하기 #7 - Locality-aware load balancing (0) | 2025.04.01 |
Istio 정복하기 #6 - Client-side load balancing (0) | 2025.03.30 |
Istio 정복하기 #5 - 트래픽 관리 - 하 (0) | 2025.03.24 |
댓글
이 글 공유하기
다른 글
-
Istio 정복하기 #9 - Circuit breaking
Istio 정복하기 #9 - Circuit breaking
2025.04.04 -
Istio 정복하기 #8 - Timeouts and retries
Istio 정복하기 #8 - Timeouts and retries
2025.04.02 -
Istio 정복하기 #7 - Locality-aware load balancing
Istio 정복하기 #7 - Locality-aware load balancing
2025.04.01 -
Istio 정복하기 #6 - Client-side load balancing
Istio 정복하기 #6 - Client-side load balancing
2025.03.30
댓글을 사용할 수 없습니다.