Monitoring and logging in a microservices architecture require centralizing logs and metrics from every service into a single place, since a request can span many services and per-service log files alone aren't enough to diagnose issues.
When a checkout request fails intermittently, a trace ID in the structured logs lets an engineer pull every log line related to that exact request across the Order, Payment, and Inventory services in Kibana, while a Grafana dashboard shows whether the failures correlate with a spike in database latency.
# Spring Boot 3.4+: structured JSON logs that log platforms can index
logging:
structured:
format:
console: ecs # Elastic Common Schema (or logstash / gelf)
# Each line is JSON and includes the trace id, so one search finds the
# whole request across services
{"@timestamp":"2026-11-01T07:15:02.311Z","log.level":"ERROR",
"service.name":"payment-service","message":"Card declined",
"traceId":"6f1c2a9e7b3d4c10","spanId":"0f9e8d7c6b5a4932"}
# Metrics -> Prometheus + Grafana, traces -> Zipkin or Tempo,
# logs -> ELK or Loki, alerts on error rate and p99 latencyA concise interview answer is
I'd centralize logs with something like the ELK stack, collect metrics with Prometheus and visualize them in Grafana, and add distributed tracing with Jaeger or Zipkin so a single request can be followed across every service it touches. Structured logging with a shared trace ID is what ties all three together for real observability.
Last updated: 1 November 2026
Previous question: Describe a scenario where a microservice might fail. How would you implement the Circuit Breaker pattern to handle failures and maintain system resilience?