Java / Micronaut Interview questions
How do you implement distributed tracing across Micronaut microservices?
Micronaut Tracing integrates with OpenTelemetry, and historically Zipkin/Brave and Jaeger via OpenTracing, to automatically propagate and record trace context across HTTP calls between services, without instrumenting every method by hand.
Adding the relevant tracing dependency, for example the OpenTelemetry HTTP module, plus exporter configuration pointing at your collector, is usually enough to get automatic spans for inbound requests, outbound @Client calls, and common integrations like database queries, all correlated under a shared trace ID that Micronaut's server and client filters propagate through request headers.
For custom spans around business logic that isn't automatically instrumented, you inject a Tracer, or use @NewSpan/@ContinueSpan annotations, to wrap specific method calls, which again is implemented through Micronaut's standard AOP interceptor mechanism rather than bespoke tracing code.
More Related questions...