Guide
Diagnosing High Latency in New Relic APM Transactions: A Step‑by‑Step Guide
Identify why New Relic transactions stall, locate the bottleneck via distributed tracing, and apply targeted fixes.
Published by Tasadduq Burney
22 Mar 2026, 19:17 UTC
3 min144.7K views0

Recognizable Condition
When monitoring New Relic APM, you notice that a service’s 95th‑percentile transaction latency consistently exceeds the expected threshold (e.g., >2 seconds) while the overall response time appears normal. This mismatch often signals a hidden bottleneck in downstream calls or database interactions.
Quick Diagnostic Table
| Symptom | Likely Source | Metric Indicator |
|---|---|---|
| High 95th‑percentile latency, normal overall response | Slow external API or N+1 database queries | ‘External’ time >> ‘Code’ time |
| High ‘Web Frontend’ but low ‘Response Time’ | CPU‑bound logic or synchronous blocking in application code | ‘Web Frontend’ high, ‘Response Time’ low |
| Spikes in ‘Database time’ on dashboard | Multiple sequential queries (N+1) instead of batched calls | ‘Database time’ > 50 % of total |
Ordered Checks
- Open the APM UI for the offending service. Navigate to
APM → Services → <YOUR_SERVICE_NAME>. Ensure you have the APM Read permission. Select a single transaction that shows the elevated 95th‑percentile latency. Risk: none, as this is a read‑only view. - Examine the Transaction Trace breakdown. In the transaction details pane, locate the “Breakdown” section. Compare the “External” time against the “Code” time. If External dominates, the bottleneck lies in downstream calls. Check: External time should be visibly larger than Code time for the suspect transaction.
- Enable Distributed Tracing (if not already active). Verify that the New Relic agent configuration includes
distributed_trace.enabled=trueand that the agent version supports the feature. Without this flag, traces will appear as disconnected segments, obscuring the true path. Risk: missing traces may mislead you to think there is no downstream dependency. - Inspect the ‘External Services’ metric. In the APM dashboard, add the “External Services” chart for the selected service. Look for a specific downstream service with elevated average response time. Placeholder:
<DOWNSTREAM_SERVICE_NAME>. If a single service shows >1 second average, it is a candidate bottleneck. - Review database query details. Click the “Data Query Details” link within the transaction trace. Identify any SQL statements with long execution times. Use the “Query Analyzer” to see if the same query is repeated multiple times (N+1 pattern). Check: Look for >1 second average execution or a count of executions >1 per transaction.
- Correlate Web Frontend metrics. If the “Web Frontend” time is high while “Response Time” remains low, the issue is likely CPU‑bound or synchronous blocking inside the application. Review the “Web Frontend” breakdown for long‑running functions. Risk: misinterpreting this may lead you to optimize the wrong layer.
Fixes Tied to Findings
- If External time dominates: Optimize the downstream API call. Consider adding caching, reducing payload size, or implementing connection pooling. Verify the change by re‑running the transaction and confirming a reduction in External time.
- If Database time spikes indicate N+1 queries: Refactor the code to batch queries or use a single JOIN. Add an index if the slow query lacks one. After deployment, re‑measure the “Database time” metric; it should drop below the previous baseline.
- If Distributed Tracing is disabled: Enable it in the agent configuration (
distributed_trace.enabled=true) and restart the agent. This will allow future transactions to show the full call graph, making bottlenecks visible. - If a specific downstream service is slow: Open a ticket with the owning team, provide the transaction ID and the measured latency, and request performance review or scaling actions.
Escalation Criteria
Escalate to the architecture or platform team when:
- Multiple downstream services show sustained latency >2 seconds despite code‑level optimizations.
- Database query analysis reveals repeated N+1 patterns across several services, indicating a design‑level issue.
- Distributed tracing remains incomplete after enabling the flag, suggesting agent misconfiguration or network interference.
- High latency persists after all targeted fixes, and the 95th‑percentile metric does not improve within a 24‑hour window.
At this point, gather full transaction traces, export the relevant logs, and share them with the platform team for deeper root‑cause analysis.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.