0Pricing
Spring Boot 4 Microservices & REST APIs · 강의

Micrometer 추적

추적 ID와 스팬 ID로 서비스에 계측을 추가해 보세요.

Micrometer 추적은(는) CoddyKit의 무료 Spring Boot 4 Microservices & REST APIs 강의입니다. 이것은 4개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Spring Boot 4 Microservices & REST APIs 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Spring Boot 4 Microservices & REST APIs 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

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: w3c

Baggage

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 Tracer to create custom spans, or use @NewSpan
  • Add tags/events; read traceId/spanId
  • Baggage propagates extra context

자주 묻는 질문

“Micrometer 추적” 강의는 무료인가요?

네 — “Micrometer 추적” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Spring Boot 4 Microservices & REST APIs 강의 전체를 잠금 해제할 수 있습니다. Spring Boot 4 Microservices & REST APIs 강의에는 총 4개의 강의가 포함되어 있습니다.

“Micrometer 추적”에서 뭘 배우나요?

추적 ID와 스팬 ID로 서비스에 계측을 추가해 보세요. 브라우저에서 직접 실행하는 실습 코드로 Spring Boot 4 Microservices & REST APIs을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Spring Boot 4 Microservices & REST APIs을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Spring Boot 4 Microservices & REST APIs은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 2번째 강의입니다.

“Micrometer 추적” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Spring Boot 4 Microservices & REST APIs 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Spring Boot 4 Microservices & REST APIs 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. 분산 추적이 중요한 이유
  2. Micrometer 추적
  3. Zipkin으로 추적 내보내기
  4. 로그와 추적 연결하기
← Spring Boot 4 Microservices & REST APIs(으)로 돌아가기