What is?
- 분산된 메시지를 추적하는 방식
- 여러개의 서비스들의 호출등을 추적하는 방식
Zipkin 사용하기
docker run -p 9411:9411 --rm openzipkin/zipkin
Client 설정하기
dependencies
dependencies {
implementation 'io.micrometer:micrometer-observation'
implementation 'io.micrometer:micrometer-tracing-bridge-otel'
implementation 'io.opentelemetry:opentelemetry-exporter-zipkin'
//Brave as Bridge
implementation 'io.micrometer:micrometer-tracing-bridge-brave'
implementation 'io.zipkin.reporter2:zipkin-reporter-brave'
//Uses Feign
implementation 'io.github.openfeign:feign-micrometer'
}
설정하기
management.tracing.sampling.probability=1.0
logging.pattern.level=%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]
- 샘필링할 확률을 설정 1.0은 모두 출력함
- logging.pattern.level 로그의 패턴을 설정