Micrometer İzleme
Hizmetleri iz ve span kimlikleriyle araçlandırın.
Micrometer İzleme, CoddyKit'te ücretsiz bir Spring Boot 4 Microservices & REST APIs dersidir. Bu, 4 dersinin 2. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Spring Boot 4 Microservices & REST APIs öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Spring Boot 4 Microservices & REST APIs kursu toplamda 4 dersten oluşur.
Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.
Micrometer Tracing overview
Micrometer Tracing is a vendor-neutral tracing facade. You code against its API, and a bridge (Brave or OpenTelemetry) does the real work and propagation.
Adding the dependencies
Add Micrometer Tracing plus a bridge. The Brave bridge is a common choice.
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-brave</artifactId>
</dependency>Auto-configuration kicks in
With the bridge on the classpath, Spring Boot auto-configures a Tracer and instruments incoming requests and outbound HTTP clients. Many spans appear with zero code.
The Tracer bean
The Tracer is the entry point for working with spans manually. It is auto-configured and injectable.
@Service
public class OrderService {
private final Tracer tracer;
public OrderService(Tracer tracer) { this.tracer = tracer; }
}Creating a custom span
Wrap a meaningful unit of work in its own span to time it and see it in the trace.
Span span = tracer.nextSpan().name("calculate-price");
try (Tracer.SpanInScope ws = tracer.withSpan(span.start())) {
calculatePrice();
} finally {
span.end();
}@NewSpan and @SpanTag
For convenience, annotate a method with @NewSpan to wrap it in a span automatically, and tag arguments with @SpanTag.
@NewSpan("load-customer")
public Customer load(@SpanTag("customerId") Long id) {
return repo.findById(id);
}Adding tags and events
Enrich spans with tags (key/value metadata) and events (timestamped notes) to make traces more diagnostic.
span.tag("user.id", userId);
span.event("cache-miss");Reading the current trace IDs
You can read the active trace and span IDs - useful for returning a trace id to clients or correlating.
Span current = tracer.currentSpan();
if (current != null) {
String traceId = current.context().traceId();
String spanId = current.context().spanId();
}Brave vs OpenTelemetry bridge
Two bridges exist: Brave (Zipkin-native) and OpenTelemetry (OTel ecosystem). Pick one - they should not be on the classpath together.
Propagation format
The bridge controls how context is propagated. You can choose formats like W3C (traceparent) or B3, which matters when integrating with other systems.
management:
tracing:
propagation:
type: w3cBaggage
Baggage is extra key/value data propagated alongside the trace context across services - e.g. a tenant id - so every downstream span and log can access it.
Quick Check
Check your Micrometer Tracing knowledge.
Recap
You used Micrometer Tracing:
- It is a facade; a Brave or OTel bridge does the real work
- Inject the
Tracerto create custom spans, or use@NewSpan - Add tags/events; read traceId/spanId
- Baggage propagates extra context
Sıkça Sorulan Sorular
“Micrometer İzleme” dersi ücretsiz mi?
Evet — “Micrometer İzleme” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Spring Boot 4 Microservices & REST APIs kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Spring Boot 4 Microservices & REST APIs kursu toplamda 4 dersten oluşur.
“Micrometer İzleme” dersinde ne öğreneceğim?
Hizmetleri iz ve span kimlikleriyle araçlandırın. Spring Boot 4 Microservices & REST APIs ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.
Spring Boot 4 Microservices & REST APIs öğrenmeye başlamak için deneyim gerekli mi?
Önceden deneyim gerekmez. CoddyKit'te Spring Boot 4 Microservices & REST APIs, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 2. dersidir.
“Micrometer İzleme” dersi ne kadar sürer?
Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.
Bu Spring Boot 4 Microservices & REST APIs dersinde kod yazıp çalıştırabilir miyim?
Evet. Her Spring Boot 4 Microservices & REST APIs dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.
Bu kursun tüm dersleri
- Dağıtık İzleme Neden Önemlidir
- Micrometer İzleme
- İzleri Zipkin'e Dışa Aktarma
- Günlükleri ve İzleri İlişkilendirme