Instrumenting Spring services
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
add traces to a Spring Boot service.
Planned topics
- Auto-instrumentation (Java agent or Spring Boot's Micrometer Tracing with an OTel bridge) covers HTTP, JDBC, and Kafka clients. Verify the supported setup for the Boot version in use before recording.
- Manual spans add business steps: "reserve-stock", "charge-payment".
- Add useful attributes (order id as span attribute is fine; as a metric label it is not).
- Configure the exporter endpoint and sampling through properties or environment variables.
Draft outline details
Demonstration
Span span = tracer.spanBuilder("reserve-stock").startSpan();
try (Scope s = span.makeCurrent()) { span.setAttribute("order.id", id); inventory.reserve(lines); }
finally { span.end(); }Check your understanding
When do you need a manual span?
Show answer
For a business step the auto-instrumentation cannot see.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.