Prompt
How do I monitor application latency across microservices
Latest observation
Oct 19, 2026
OpenAI APIWeb search: off
To monitor application latency across microservices, you want visibility at three levels:
- Overall user/request latency
- Per-service latency
- Latency between services on each hop
The best way to do that is with distributed tracing + metrics + logs.
1) Measure latency with distributed tracing
Use tracing to follow a single request as it moves through services.
- Add a trace ID to every request
- Propagate it across all microservices
- Instrument each service to create spans around:
- inbound requests
- outbound calls
- database calls
- queue operations
This lets you see:
- total end-to-end latency
- which service adds the most delay
- whether the slowdown is in network, app logic, or dependencies
Common tools:
- OpenTelemetry for instrumentation
- Jaeger, Zipkin, or Grafana Tempo for trace storage/viewing
2) Track latency as metrics
Use metrics for fast alerting and trends.
Important latency metrics:
- p50 / p95 / p99 response time
- request duration per endpoint
- upstream/downstream call duration
- queue wait time
- DB query latency
Best practice:
- use histograms or summary metrics
- break down by:
- service name
- endpoint
- status code
- dependency type
- region/cluster/version
Example alerts:
- p95 latency > 500ms for 5 minutes
- error rate increases with latency
- one service’s downstream call latency spikes
Common stack:
- Prometheus for metrics collection
- Grafana for dashboards
3) Correlate logs with traces
Logs help explain why latency increased.
- Include
trace_id,span_id, request ID, and service name in every log line - Search logs for a slow trace to see:
- retries
- timeouts
- GC pauses
- lock contention
- DB slowness
- dependency failures
Tools:
- ELK/EFK
- Loki
- Splunk
- Datadog Logs
4) Build dashboards by service and path
Create dashboards for:
- overall request latency
- latency per service
- latency per endpoint
- service dependency map
- slowest traces
- error rate alongside latency
Useful views:
- service map
- top N slow traces
- latency heatmaps
- dependency latency breakdown
5) Use SLOs and alerts
Define latency SLOs such as:
- 95% of requests under 300ms
- 99% of checkout requests under 1s
Then alert on:
- SLO burn rate
- p95/p99 regression
- unusual latency spikes
- dependency-specific latency increases
6) Practical implementation pattern
A typical setup looks like this:
- Instrument services with OpenTelemetry SDK
- Export traces to Tempo/Jaeger
- Export metrics to Prometheus
- Send logs to Loki/ELK
- Use Grafana to correlate traces, metrics, and logs
7) What to watch for
Latency problems in microservices often come from:
- too many synchronous hops
- network overhead
- retries multiplying latency
- cold starts
- DB bottlenecks
- lock contention
- misconfigured timeouts
- thundering herd effects
Quick recommendation
If you’re starting from scratch:
- OpenTelemetry for instrumentation
- Prometheus + Grafana for metrics
- Jaeger or Grafana Tempo for traces
- Centralized logs with
trace_id
If you want, I can also give you:
- a reference architecture
- a Prometheus/Grafana dashboard layout
- or an OpenTelemetry example for a microservice stack