Find the slow call sooner with the updated APM flamechart and waterfall

| 5 min. (923 words)

When a request is slow, the trace should tell you why. In a modern web application, though, the call that matters is often buried under the middleware pipeline: a dozen layers that each pass the request on, and each one shows the full request time.

We’ve updated the two views you use most on an APM trace, the Flamechart and the Waterfall (previously the Call tree), so the call that costs the time is on screen as soon as the trace opens.

Middleware used to fill the screen

Here’s a 153ms request in the previous flamechart. Almost every row on the first screen is middleware that passes the request on to the next. The database query that takes 130ms of the request is below the fold.

The previous flamechart, filled with rows of middleware that each take the full request time.

The previous flamechart. Screenshots in this post use an example trace from a sample application.

The Call tree had the same problem. Tall rows and full namespaces meant one screen showed about a dozen calls, and many of them showed the full 153ms.

The previous Call tree, with long namespaced middleware rows that each show 153ms.

The previous Call tree.

Pass-through calls fold away

Both views now recognize pass-through calls: calls that hand almost all of their time to one other call. When two or more run in a chain, they fold into one striped row, such as 9 pass-through calls, and the call they hand the work to shows below it.

Nothing is hidden for good. Hover over a folded row to see each call in the chain with its own time, click it to unfold it, or turn off Fold pass-through calls to see everything. A call with an error never folds, so a failing check in your middleware keeps its own row.

The flamechart shows the whole request at a glance

With the middleware folded, the same request fits on one screen. The controller, the service it calls, and the 130ms query sit one under the other, and a flame marks the call where the hotpath ends.

The updated flamechart. Two folded rows replace 16 pass-through calls, and the 130ms query is visible with a flame icon.

The updated flamechart: two folded rows replace 16 pass-through calls.

Each block shows its name, and its duration when there’s room. The flamechart also has new ways to find and focus on calls:

  • Find calls or queries: search by name, query text, database or host. Matches get a red outline and everything else fades, and you can step through them in the order they ran.
  • Show: turn each call type on or off. Each chip shows that type’s own time.
  • Zoom: drag across the strip above the chart, double-click a block, or pinch. Scrolling with Ctrl or ⌘ zooms too, and the mouse wheel on its own now scrolls the page instead of the chart.
  • Details beside the chart: click a block and its details, including formatted SQL for a query, open in a side panel.
  • Keyboard: the arrow keys move between calls, and = and - zoom.

The waterfall gives every call its own time

The Call tree is now the Waterfall. Rows are compact, so nearly twice as many fit on one screen, and names leave out the namespace. Turn on Full names when you need it.

Each row shows the call’s Total time and its Own time: the time it spent working itself, not waiting on the calls it made. On the timeline, a bar is pale while the call waits and solid while it works, so you can tell a controller that waits 141ms on a query from one that does 141ms of work.

The updated waterfall. A summary says 85% of the request’s time is spent in one query, and an orange line follows the hotpath to it.

The waterfall opens with the hotpath expanded and names the slow query.

The waterfall opens with the hotpath expanded, and a summary tells you where the time goes: “85% of the request’s time is spent in SELECT … FROM conversation_share (130ms)”. Click the name to go to the call. Click any row to open its details, with formatted SQL for a query, under the row. Or filter the waterfall by name, query text, database or host, with the matching text highlighted.

A hotpath that ends where the time goes

The hotpath is the chain of calls that leads to where a request’s time goes. It used to follow the longest call at each level until it ran out of calls, which could leave it on a small call at the bottom of the tree. On one of our test traces, it ended at a 1.4ms response read, while a query that took almost half of the request wasn’t on the path at all.

Now the hotpath follows a call only while that call takes most of the time. When a method and the query it runs take about the same time, it prefers the query, because that’s where the work happens. When the time is spread across many calls, the summary says so and lists the biggest groups instead of picking one.

The flamechart, the waterfall and the call details all use the same hotpath.

One set of tools across the views

The flamechart and the waterfall share the same hover cards. Each card shows the call’s type, its full name, a bar of its own work against the time it waited, and its start, total, own time and share of the trace. Folding and search carry from one view to the other, and the selected call stays selected when you switch tabs.

Try it on your next slow trace

Open any trace in Raygun APM to see the updated flamechart and waterfall.

We’ve also added two new ways to read a trace, Lanes and Time map. Find out what they show.

Open Raygun and take a look at your slowest requests.