Spring Cloud로 개발하는 MSA/장애 처리와 Microservice 분산 추적

분산 추적의 개요 Zipkin 서버 설치

webmaster 2022. 2. 10. 12:50
728x90

ZipKin

  • Twitter에서 사용하는 분산 환경의 Timing 데이터 수집, 추적 시스템(오픈소스)
  • 분산 환경에서의 시스템 병목 현상 파악
  • Collector, Query Service, Database, WebUI로 구성
  • 용어 정리 
    • span : 하나의 요청에 사용되는 작업의 단위
    • trace : 트리구조로 이루어진 Span Set
  • https://zipkin.io/
 

OpenZipkin · A distributed tracing system

Zipkin Zipkin is a distributed tracing system. It helps gather timing data needed to troubleshoot latency problems in service architectures. Features include both the collection and lookup of this data. If you have a trace ID in a log file, you can jump di

zipkin.io

  • 설치하기
    • 다운로드
    • 정상 실행

Spring Cloud Sleuth 

  • Springboot Application을 Zipkin과 연동
  • 요청 값에 따른 Trace Id, Span Id 부여
  • Trace와 Span Ids를 로그에 추가한다.

Spring Cloud Sleuth + Zipkin을 이용한 Microservice의 분산 추적

  • 의존성 추가
    • UserService,OrderService의 Pom.xml
  • Yml 추가
    • UserService,OrderService의 application.yml
728x90