Zipkin
💡분산 추적 시스템 이란?
- 분산 추적 시스템(Distributed Tracing System)은 마이크로서비스 아키텍처에서 여러 서비스를 거치는 요청의 흐름을 추적하고 분석하는 기술이다.
- 단일 사용자 요청이 여러 서비스를 경유하면서 발생하는 모든 작업을 시각화하여, 각 구간에서 소요된 시간과 성능 병목 지점을 파악할 수 있게 한다.
💡Zipkin 이란?
💡MSA 환경에서 Zipkin 활용하는 이유
사용 방법
💡Java, Spring Boot 환경에서 사용하는 방법
- Micrometer Tracing(분산 추적 기능 제공 라이브러리)을 사용하여 Zipkin과 통합
- Micrometer가 각 요청의 추적 데이터를 자동으로 수집하고, 그 정보를 Zipkin 서버로 전달해준다.
- Zipkin은 전달받은 트레이스 데이터를 저장, 시각화하여 서비스 간 호출 관계 및 성능 병목 지점을 확인할 수 있게 한다.
- build.gradle 의존성 추가
dependencies {
// zipkin
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-tracing-bridge-brave'
implementation 'io.zipkin.reporter2:zipkin-reporter-brave'
implementation 'io.github.openfeign:feign-micrometer'
}
- application.yml 설정
spring:
application:
name: user-service
zipkin:
base-url: http://localhost:9411 # Zipkin 서버 URL
management:
tracing:
sampling:
probability: 1.0 # 0.0 ~ 1.0, 1.0은 모든 요청 추적
zipkin:
tracing:
endpoint: http://localhost:9411/api/v2/spans
💡Zipkin 서버 구동
- 가장 간단하게는 Docker를 사용할 수 있다.
docker run -d -p 9411:9411 openzipkin/zipkin
💡활용 방법
참고 자료
1) Zikin docs
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
2) Geeks for Geeks
https://www.geeksforgeeks.org/system-design/distributed-tracing-in-microservices/
Distributed Tracing in Microservices - GeeksforGeeks
Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.
www.geeksforgeeks.org
'심화 > MSA' 카테고리의 다른 글
| [MSA] FeignClient vs WebClient (0) | 2025.11.21 |
|---|---|
| [대규모 스트림 처리] 수백만 명의 사용자가 동시에 접속하는 시스템을 어떻게 만들지? (0) | 2025.11.18 |
| [IntelliJ] DSM(Dependency Structure Matrix) (0) | 2025.11.06 |
| [MSA] Spring Boot 개별 인스턴스 yml 설정 (0) | 2025.11.05 |
| [MSA] Spring Cloud Config (0) | 2025.11.04 |