Saltar al contenido principal

Trace a Slow Endpoint

Add request tracing that separates route latency, dependency latency, and error context.

backend-development5 min read

POST /quotes has p95 latency above 4 seconds, but the backend only logs total request duration. Use traces for request causality, metrics for aggregate behavior, and logs for contextual events. Adding one giant timer looks like observability, but it cannot separate database time, vendor timeout, retries, serialization, or queue publish latency. Root span Create a server span named POST /quotes using the route template, not a unique URL. The route template keeps grouping useful and avoids high-cardinality path labels. Dependency spans Add child spans for db.quote_inputs, cache.customer_tier, and each vendor pricing request. Child spans reveal which dependency owns the slow…

Read the full lesson

Sign up free: one personalized lesson every day, matched to your role and goals.

← Back to library

Contáctanos