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).
  1. Initialize SDK during application startup.
  2. Instrument inbound HTTP requests.
  3. Capture exceptions and map to traces.
  4. Instrument DB and external client calls.

Minimum Data Contract

  • service, env, version tags in every signal.
  • Release metadata for deployment correlation.
  • Error events with stack context and route name.

Validation Checklist

  • Boot sequence emits startup signal.
  • 5xx responses are trace-linked.
  • Slow queries appear in span timeline.

Production Hardening

  1. Ensure shutdown hooks flush telemetry.
  2. Keep retry bounded to avoid cascading failures.
  3. Add alerts on ingestion/auth errors.
  4. Validate after dependency and Java version updates.

Troubleshooting

  • No data after startup refactor: confirm bean init path.
  • Missing DB spans: ensure instrumentation wraps driver/repo boundaries.
  • High cardinality: normalize dynamic tag values.

On this page