Spring Boot Project Guide
Complete instrumentation pattern for Spring Boot services
Use this guide for Spring Boot services where request pipelines, services, and repositories must remain diagnosable.
Architecture Scope
- Controllers and servlet filter chain.
- Service and repository layers.
- Outbound clients (HTTP, messaging, DB).
Setup
Register the Obtrace client as a Spring bean and add the filter for request instrumentation:
The SpringObtraceFilter auto-captures every HTTP request as a span with method, route, status, and duration. All java.util.logging output is also captured automatically.
Environment Variables
Validation Checklist
- Boot sequence emits startup signal
- 5xx responses are trace-linked
- Slow queries appear in span timeline
- JVM shutdown hook flushes pending telemetry
Production Hardening
- Ensure shutdown hooks flush telemetry (
ObtraceClientregisters one by default). - Keep retry bounded to avoid cascading failures.
- Add alerts on ingestion/auth errors.
- Validate after dependency and Java version updates.
Troubleshooting
- No data after startup refactor: confirm
@Configurationclass is scanned. - Missing DB spans: wrap JDBC calls with
client.span(). - High cardinality: normalize dynamic tag values.