spring: zipkin.enabled: true zipkin: base-url: ${ZIPKIN_BASE_URL:http://localhost:9411} sender: type: web # not sure if sleuth config is required or not sleuth: sampler: probability: "1.0"
Launch Zipkin server:
# Navigate to http://localhost:9411/zipkin on browserdocker run -d -p 9411:9411 openzipkin/zipkin
Download opentelemetry-javaagent.jar
Launch app:
# OTEL supports:# OTEL_LOGS_EXPORTER, OTEL_METRICS_EXPORTER, OTEL_TRACES_EXPORTERexport OTEL_METRICS_EXPORTER="otlp" # Is this required?export OTEL_SERVICE_NAME=bff-mobileexport OTEL_TRACES_EXPORTER=zipkin# Use this to check if OTEL javaagent is really workingexport OTEL_JAVAAGENT_DEBUG=true# Build the jar./gradlew clean build -x testjava -javaagent:./service/build/docker/opentelemetry-javaagent-1.31.0.jar -jar ./service/build/libs/bff-mobile-0.536.0-SNAPSHOT-application.jar
The following screenshot is from zipkin capturing info
There are multiple spans of service bff-mobile denoting:
Tracing Context: Identifier (Trace identifier/span identifier etc.) that must be propagated through the process and over network
Spans are collected from all the places and then unified using tracing context (traceId) which will be unique for all the requests between microservices
Trace ID
Trace ID needs to be propagated and consumed. so that when collected they can be unified in distributed tracing software and show information