MeshConfig와 pod annotations로 추적 설정하기

MeshConfig와 pod annotations로 추적 설정하기

MeshConfig와 pod annotations를 사용해서 추적 옵션을 설정하는 방법을 알려드려요.

출처: Istio 문서

본문

이 작업은 MeshConfig와 pod annotations를 사용해서 추적 옵션을 설정하는 방법을 보여줘요.

시작하기 전에

  1. bookinfo 샘플을 설치해요.
  2. bookinfo 샘플로 트래픽을 생성해요.

추적 설청 (ConfigureTracing)

추적 공급자 유형을 사용해서 프록시가 추적을 보내도록 설정해요. 아래 예시는 프록시가 tracing.istio-system:9411로 요청을 보내는 공급자에게 추적을 보내도록 설정해요. 이제 추적 공급자는 extension providers 배열로 설정되기 때문에 defaultConfig.tracing은 폐기(deprecated) 예정이며 향후 릴리스에서 제거될 거예요. 데이터 공급자는 MeshConfig.extensionProviders로 설정돼요.

Istio 메시(spec.meshConfig.defaultConfig.tracing)와 워크로드별(pod spec annotation) 추적 옵션을 설정해요:

apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
  meshConfig:
    defaultConfig:
      tracing:
        sampling: 100
        max_path_tag_length: 256
        custom_tags:
          litmus:
            literal:
              value: "chaos"
        zipkin:
          address: zipkin.istio-system:9411

그리고 아래처럼 pod spec annotation에 워크로드별 옵션을 설정해요:

apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
  meshConfig:
    defaultConfig:
      zipkin:
        address: zipkin.istio-system:9411
  profile: demo

pod annotation으로 추적을 설정할 때는 tracing.sampling과 tracing.custom_tags를 사용할 수 없다는 점에 주의하세요.

설정 검증

추적 설정이 제대로 적용되었는지 검증해요.

다음 단계

추적을 위한 프록시 설정을 확인해서 워크로드별 옵션으로 프록시 기반 설정을 사용하는 방법에 대해 더 알아보세요.

함께 보기

  • 분산 추적의 개요(리소스 포함)

더 알아보기 (Learn more)