Background
Correlation IDs are propagated through MDC and response headers, but there is no span-level distributed trace. This makes it hard to visualise the latency breakdown across Redis → Kafka → PostgreSQL for a single request.
Proposed Change
Add Micrometer Tracing with an OTLP exporter so every order request produces a complete trace.
Dependencies
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-otel</artifactId>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporter-otlp</artifactId>
</dependency>
Config
management:
tracing:
sampling:
probability: 1.0
otlp:
tracing:
endpoint: http://otel-collector:4318/v1/traces
Docker Compose additions
- OpenTelemetry Collector sidecar
- Jaeger UI for trace visualisation
Acceptance Criteria
Background
Correlation IDs are propagated through MDC and response headers, but there is no span-level distributed trace. This makes it hard to visualise the latency breakdown across Redis → Kafka → PostgreSQL for a single request.
Proposed Change
Add Micrometer Tracing with an OTLP exporter so every order request produces a complete trace.
Dependencies
Config
Docker Compose additions
Acceptance Criteria
traceIdappears in log lines alongsidecorrelationIddocker-compose.yml