Prompt
How do I troubleshoot a failing transaction across multiple services?
Latest observation
To troubleshoot a failing transaction across multiple services, work from symptoms → trace → service-by-service checks → root cause.
1) Start with the failure details
Capture:
- User-visible error
- Timestamp
- Request ID / correlation ID / trace ID
- Which endpoint / workflow failed
- Environment: prod, staging, region, deployment version
This lets you follow the request across logs, metrics, and traces.
2) Follow the transaction end-to-end
Use distributed tracing if available:
- Find the root span
- Identify the slowest or failed child span
- Note where the request first turns into an error or timeout
If you don’t have tracing, reconstruct the path from:
- API gateway logs
- Service logs
- Downstream dependency logs
- Queue/event consumer logs
3) Check the most common failure classes
Look for:
A. Timeouts / latency
- One service is slow
- Downstream dependency is slow
- Retries are amplifying load
- Connection pool exhaustion
Check:
- p95/p99 latency
- timeout settings
- retry counts
- thread/worker saturation
B. Errors from a downstream dependency
- DB failures
- Cache misses or cache outages
- Third-party API errors
- Message broker issues
Check:
- HTTP status codes / exception types
- dependency health dashboards
- circuit breaker state
- queue lag / consumer backlog
C. Data or contract mismatch
- Schema changes
- Missing fields
- Serialization/deserialization errors
- Version incompatibility between services
Check:
- request/response payloads
- recent deploys
- schema registry / API contract changes
D. Resource exhaustion
- CPU, memory, disk, file descriptors
- DB connection pool depletion
- queue consumer starvation
Check:
- container/node metrics
- autoscaling activity
- GC pauses
- pod restarts / OOM kills
E. Authentication / authorization issues
- Expired tokens
- IAM/role misconfigurations
- certificate problems
Check:
- auth service logs
- token validation errors
- TLS/cert expiry
4) Compare against recent changes
Most transaction failures are caused by a recent change:
- New deployment
- Config change
- Feature flag rollout
- Dependency upgrade
- Infrastructure change
Ask:
- Did the failure start right after a deploy?
- Only one region/tenant/version affected?
- Is it reproducible with the same inputs?
5) Isolate the failing segment
Work backward from the failing service:
- If service C fails, verify whether service B sent bad data or timed out
- If B is fine, inspect A’s request shaping/auth/retry logic
- Test each hop independently with a known-good request
Useful techniques:
- Replay the request in staging
- Synthetic checks
- Curl/Postman/manual API calls
- Temporary log-level increase for the trace ID
6) Validate logs, metrics, and traces together
Use a 3-part view:
- Logs: exact error messages
- Metrics: frequency, latency, saturation, error spikes
- Traces: where time or failure occurs
A single trace can show the “where,” while metrics show the “how widespread.”
7) Look for retry storms and cascading failures
Retries can make a small outage look like a big one. Check:
- Exponential backoff
- Retry budget
- Idempotency
- Circuit breakers
- Bulkheads / rate limits
8) Confirm the fix
After identifying the cause:
- Roll back or patch
- Verify the transaction succeeds end-to-end
- Watch metrics for recovery
- Confirm no secondary effects
9) Prevent it from recurring
Add:
- Better correlation IDs
- Distributed tracing coverage
- Service SLOs and alerts
- Contract tests
- Chaos testing / failure injection
- Clear retry and timeout policies
Quick triage checklist
- Get trace ID / request ID
- Find failing span/service
- Check recent deploys/config changes
- Inspect logs for exact exception
- Check latency, error rate, saturation
- Validate downstream dependency health
- Test retry/timeouts/circuit breakers
- Confirm with a replay or synthetic test
If you want, I can also give you a step-by-step troubleshooting playbook for a specific stack like microservices on Kubernetes, AWS, or Java/Spring + Kafka + PostgreSQL.