Query timeouts don't always originate inside the database. Round trip query latency includes every hop between the application and the database, such as connection pools, load balancers, and proxies. By correlating APM traces (which measure full round trip time from the application's perspective) with Database Monitoring data (which measures only in-database execution time via pg_stat_statements), it's possible to decompose latency into 'database time' vs. 'everything else.' A worked example shows how a saturated PgBouncer CPU caused timeouts while database metrics remained normal, allowing engineers to skip query optimization and fix the actual bottleneck. Datadog's 'Round Trip Overhead Analysis' view surfaces this ratio and its components to accelerate such investigations.
Table of contents
Round trip latency involves more than the databaseSeparating round trip time from database timeWalkthrough: Troubleshooting an underprovisioned connection poolHow Datadog connects APM and Database MonitoringDiagnose query latency across your full stack with APM and Database MonitoringSort: