micrometer-tracing
БесплатноБез исполняемых скриптовНе проверенDistributed tracing and observability with Micrometer and Spring Boot 3
от claude-dev-suite★ 51 звезда на GitHubОб этом скилле
Micrometer Tracing - Quick Reference
Full Reference: See advanced.md for custom ObservationConvention, baggage propagation, logging integration, metrics, async tracing, and testing patterns.
Deep Knowledge: Use
mcp__documentation__fetch_docswith technology:micrometer-tracingfor comprehensive documentation.
Dependencies
<!-- Micrometer Tracing Bridge (choose one) -->
<!-- For Brave (Zipkin) -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-brave</artifactId>
</dependency>
<!-- For OpenTelemetry -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-otel</artifactId>
</dependency>
<!-- Reporter (choose one) -->
<dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-reporter-brave</artifactId>
</dependency>
Configuration
spring:
application:
name: order-service
management:
tracing:
sampling:
probability: 1.0 # Sample 100% in dev, lower in prod
zipkin:
tracing:
endpoint: http://localhost:9411/api/v2/spans
logging:
pattern:
level: "%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]"
Core Concepts
┌─────────────────────────────────────────────────────────────┐
│ Trace (End-to-End Request) │
│ TraceId: abc123 │
│ │
│ ┌──────────────────┐ │
│ │ Span: API Gateway│ SpanId: 001 (Parent) │
│ └────────┬─────────┘ │
│ │ │
│ ┌────────▼─────────┐ ┌─────────────────┐ │
│ │ Span: Order Svc │ │ Span: User Svc │ │
│ │ SpanId: 002 │ │ SpanId: 003 │ │
│ └──────────────────┘ └─────────────────┘ │
└─────────────────────────────────────────────────────────────┘
Automatic Instrumentation
Spring Boot 3 auto-instruments:
- HTTP Server (Spring MVC, WebFlux)
- HTTP Client (RestTemplate, WebClient, RestClient)
- JDBC, Kafka, RabbitMQ, Redis, MongoDB
- Scheduled Tasks
Using Observation API
@Service
@RequiredArgsConstructor
public class OrderService {
private final ObservationRegistry observationRegistry;
public Order processOrder(OrderRequest request) {
return Observation.createNotStarted("order.process", observationRegistry)
.lowCardinalityKeyValue("order.type", request.getType())
.highCardinalityKeyValue("order.id", request.getId())
.observe(() -> {
Order order = createOrder(request);
validateOrder(order);
return saveOrder(order);
});
}
}
Using @Observed Annotation
@Configuration
public class ObservationConfig {
@Bean
public ObservedAspect observedAspect(ObservationRegistry registry) {
return new ObservedAspect(registry);
}
}
@Service
public class PaymentService {
@Observed(
name = "payment.process",
contextualName = "process-payment",
lowCardinalityKeyValues = {"payment.method", "credit_card"}
)
public PaymentResult processPayment(PaymentRequest request) {
return paymentGateway.charge(request);
}
}
HTTP Client Tracing
@Configuration
public class RestClientConfig {
@Bean
public RestClient restClient(RestClient.Builder builder) {
return builder
.baseUrl("http://order-service")
.build(); // Auto-instrumented in Spring Boot 3
}
}
Best Practices
| Do | Don't |
|---|---|
| Use low cardinality for tags | High cardinality in metrics |
| Sample appropriately in prod | 100% sampling in production |
| Propagate context in async | Lose trace context |
| Use meaningful span names | Generic names like "process" |
| Include traceId in logs | Log without correlation |
Production Configuration
management:
tracing:
sampling:
probability: 0.1 # Sample 10% in production
zipkin:
tracing:
endpoint: ${ZIPKIN_URL:http://zipkin:9411}/api/v2/spans
metrics:
tags:
application: ${spring.application.name}
environment: ${ENVIRONMENT:development}
Checklist
- Sampling rate configured
- Trace exporter configured (Zipkin/Jaeger/OTLP)
- Logging includes traceId/spanId
- Baggage propagation configured
- Async context propagation working
- Custom observations for business ops
- Metrics exported to monitoring
- Health checks include tracing
- Error tracking in spans
- Performance overhead measured
Reference
Установить micrometer-tracing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobWriteEditВложенные файлы
FAQ
Что делает скилл micrometer-tracing?
Distributed tracing and observability with Micrometer and Spring Boot 3
Как установить скилл micrometer-tracing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл micrometer-tracing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic