0Pricing
Spring Boot 4 Microservices & REST APIs · Lesson

Exporting Traces to Zipkin

Visualize traces in Zipkin.

Exporting Traces to Zipkin is a free Spring Boot 4 Microservices & REST APIs lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Spring Boot 4 Microservices & REST APIs learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Why an exporter is needed

Creating spans is not enough - they must be exported to a backend that stores and visualizes them. Zipkin is a popular, easy-to-run choice.

Running Zipkin

The simplest way to run Zipkin locally is its Docker image. It exposes a UI and an ingest API on port 9411.

// docker run -d -p 9411:9411 openzipkin/zipkin
// UI at http://localhost:9411

Adding the Zipkin reporter

Add the reporter dependency so finished spans are sent to Zipkin.

<dependency>
  <groupId>io.zipkin.reporter2</groupId>
  <artifactId>zipkin-reporter-brave</artifactId>
</dependency>

Configuring the endpoint

Tell Spring where Zipkin lives. The default endpoint is the local Zipkin ingest URL.

management:
  zipkin:
    tracing:
      endpoint: http://localhost:9411/api/v2/spans

Setting the sampling rate

Combine the exporter with a sampling probability. In development you often sample 100% to see every trace.

management:
  tracing:
    sampling:
      probability: 1.0   # 100% in dev

Service name in Zipkin

Spans are grouped by service. Zipkin uses spring.application.name as the service name, so set it meaningfully on each app.

spring:
  application:
    name: order-service

How spans reach Zipkin

Each service buffers finished spans and reports them to Zipkin asynchronously (over HTTP by default). Zipkin joins spans sharing a traceId into one trace.

Exploring traces in the UI

In the Zipkin UI you search by service, span name, tag or duration, then open a trace to see the waterfall of spans across all services.

Reading the dependency graph

Zipkin can render a service dependency diagram from collected traces, showing which services call which - a live map of your architecture.

Alternative backends

The same Micrometer setup can export elsewhere. With the OpenTelemetry bridge you can send to OTLP-compatible backends (Tempo, Jaeger, vendors) instead of Zipkin.

Production considerations

In production, lower the sampling rate, secure the Zipkin endpoint, and ensure the reporter's async queue does not drop too many spans under load. Tracing should never harm request latency.

Quick Check

Confirm your exporter knowledge.

Recap

You exported traces to Zipkin:

  • Run Zipkin (port 9411) and add the Zipkin reporter
  • Set the endpoint and a sampling probability
  • spring.application.name is the Zipkin service name
  • Explore waterfalls and the service dependency graph in the UI

Frequently asked questions

Is the “Exporting Traces to Zipkin” lesson free?

Yes — the full text of “Exporting Traces to Zipkin” is free to read here on the web, and the Spring Boot 4 Microservices & REST APIs course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Spring Boot 4 Microservices & REST APIs course, upgrade to CoddyKit PRO.

What will I learn in “Exporting Traces to Zipkin”?

Visualize traces in Zipkin. You practise Spring Boot 4 Microservices & REST APIs with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Spring Boot 4 Microservices & REST APIs?

No prior experience is required. Spring Boot 4 Microservices & REST APIs on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Exporting Traces to Zipkin” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Spring Boot 4 Microservices & REST APIs lesson?

Yes. Every Spring Boot 4 Microservices & REST APIs lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Why Distributed Tracing Matters
  2. Micrometer Tracing
  3. Exporting Traces to Zipkin
  4. Correlating Logs and Traces
← Back to Spring Boot 4 Microservices & REST APIs