Scenario
An e-commerce platform's Kubernetes cluster experiences a sudden latency spike in the order-service microservice during peak hours, from an average of 200ms to 2s, causing order timeouts. The team has Prometheus + Grafana for monitoring and OpenTelemetry for distributed tracing.
Symptoms
- Grafana dashboard shows P99 HTTP request latency for
order-servicerising from 200ms to 2s - Pod CPU usage not significantly increased, but memory consumption steadily climbs
- OpenTelemetry traces reveal the
/checkoutendpoint is the bottleneck, withpayment-gatewaycalls taking 1.5s
Diagnosis
- Open Grafana, examine the
http_request_duration_secondshistogram fororder-serviceto confirm P99 latency - Check Pod resource usage:
kubectl top pod -n production -l app=order-service; memory is growing and near OOM limits - In OpenTelemetry UI (e.g., Jaeger), select a
/checkouttrace;payment-gatewayshows 3 retries due to timeout - Inspect
payment-gatewaymetrics: its Grafana panel shows 5% error rate and P95 latency of 8s
Commands
# Query latency histogram (PromQL)
histogram_quantile(0.99, sum(rate(http_request_duration_seconds_bucket{service="order-service", endpoint="/checkout"}[5m])) by (le))
# Check pod resources
kubectl top pod -n production -l app=order-service
# View last 100 logs
kubectl logs --tail=100 -n production deployment/order-service
echo "Payment gateway is slow; consider circuit breaking"
Risk Controls
- Ensure Grafana slow-query alerts are active and notified to SRE before changes
- Disable automatic circuit breaker on
payment-gatewayto avoid cascading failures - Backup ConfigMap:
kubectl get configmap -n production order-service-config -o yaml > /tmp/order-config-backup.yaml
Rollback
If latency does not improve after fix:
kubectl rollout undo deployment/order-service -n production
kubectl rollout status deployment/order-service -n production
If configuration changed, revert:
kubectl apply -f /tmp/order-config-backup.yaml
Verification
- Run load test:
hey -z 30s -c 10 http://order-service.production/checkout - Confirm Grafana shows P99 latency below 300ms
- Check OpenTelemetry traces:
payment-gatewaycall under 500ms - Verify no new error logs
When to Submit an OpsGlobal Ticket
- If your team lacks OpenTelemetry tracing and needs deployment assistance
- When cascading failures across multiple services cannot be isolated
- For advanced alerting configuration (e.g., SLO-based alerts)
- If cluster resource bottleneck analysis exceeds team's capability
Use cases
Useful for teams handling Observability issues and needing a clear troubleshooting and delivery workflow.
Problem background
This article walks through a real-world scenario to diagnose a microservice latency spike using Prometheus, Grafana, and OpenTelemetry, with step-by-step commands, risk controls, and rollback procedures.
Troubleshooting steps
Confirm impact and recent changes, collect logs, configuration and metrics, then apply fixes from low to high risk.
Command examples
Replace sample resource names with real values and store passwords, tokens and keys in environment variables.
Risks
Before production changes, confirm backups, access boundaries, change windows and rollback paths.
Rollback plan
Keep original configuration and release versions; roll back config, images or database changes if metrics degrade.
Deliverables
Root-cause notes, key commands, remediation steps, verification results and follow-up recommendations.
Need help with a similar technical issue?
If your servers, Kubernetes, Docker, CI/CD, databases or monitoring systems have similar issues, submit logs and config files for remote diagnosis.