Mengekspor Jejak ke Zipkin
Visualisasikan jejak di Zipkin.
Mengekspor Jejak ke Zipkin adalah pelajaran Spring Boot 4 Microservices & REST APIs gratis di CoddyKit. Ini adalah pelajaran 3 dari 4. Kamu bisa membaca pelajaran lengkapnya di bawah secara gratis — lalu praktikkan langsung di browser dengan editor kode bawaan dan tutor AI 24/7. Ini adalah bagian dari jalur belajar Spring Boot 4 Microservices & REST APIs, dan progresmu tersinkronisasi di web dan aplikasi CoddyKit. Kursus Spring Boot 4 Microservices & REST APIs mencakup 4 pelajaran total.
Bagian dari pelajaran ini belum diterjemahkan dan ditampilkan dalam bahasa Inggris.
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:9411Adding 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/spansSetting 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 devService 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-serviceHow 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.nameis the Zipkin service name- Explore waterfalls and the service dependency graph in the UI
Pertanyaan yang Sering Diajukan
Apakah pelajaran “Mengekspor Jejak ke Zipkin” gratis?
Ya — teks lengkap “Mengekspor Jejak ke Zipkin” gratis dibaca di sini di web. Untuk praktiknya secara interaktif (editor kode bawaan dan tutor AI 24/7) dan buka sisa kursus Spring Boot 4 Microservices & REST APIs, upgrade ke CoddyKit PRO. Kursus Spring Boot 4 Microservices & REST APIs mencakup 4 pelajaran total.
Apa yang akan aku pelajari di “Mengekspor Jejak ke Zipkin”?
Visualisasikan jejak di Zipkin. Kamu berlatih Spring Boot 4 Microservices & REST APIs dengan kode praktik yang langsung kamu jalankan di browser, dan tutor AI 24/7 menjawab pertanyaanmu saat kamu mengerjakan pelajaran ini.
Apakah aku perlu pengalaman untuk memulai Spring Boot 4 Microservices & REST APIs?
Tidak diperlukan pengalaman sebelumnya. Spring Boot 4 Microservices & REST APIs di CoddyKit dirancang untuk pemula hingga pelajar tingkat lanjut, jadi kamu bisa memulai di sini atau dari awal dan belajar sesuai kecepatan kamu sendiri. Ini adalah pelajaran 3 dari 4.
Berapa lama pelajaran “Mengekspor Jejak ke Zipkin” memakan waktu?
Sebagian besar pelajaran CoddyKit memakan waktu sekitar 5–10 menit. Setiap pelajaran ringkas dan interaktif, jadi kamu membuat kemajuan stabil dan melanjutkan dari tempat kamu tinggalkan di web dan aplikasi.
Bisakah aku menulis dan menjalankan kode dalam pelajaran Spring Boot 4 Microservices & REST APIs ini?
Ya. Setiap pelajaran Spring Boot 4 Microservices & REST APIs menyertakan editor kode bawaan, jadi kamu menulis dan menjalankan kode nyata langsung di browser dan mendapatkan umpan balik AI instan — tidak diperlukan penyiapan lokal.
Semua pelajaran dalam kursus ini
- Mengapa Pelacakan Terdistribusi Penting
- Pelacakan Micrometer
- Mengekspor Jejak ke Zipkin
- Menghubungkan Log dan Jejak