IntelliJ IDEA 2020.3 Help

Async Stack Traces

Use this page to configure capture points to facilitate debugging of asynchronous code.

A capture point is a place in your code where the debugger captures stack traces to be used later when you reach a specific point in the code (the insertion point) and want to see how you got there. IntelliJ IDEA does this by substituting part of the call stack with a captured stack.

Asynchronous stack traces are enabled by default. To disable them, deselect the Instrumenting agent (requires debugger restart) option. The most common capture points are built-in, so no configuration is required.

If you need to use capture points that are not included in the default configuration, you can use the Async.Schedule and Async.Execute annotations that reside in the public JetBrains annotations package and can be referenced in your code. To use them, add this Maven repository as a dependency for your artifacts.

If you cannot use annotations or need to be able to capture local variables, you can configure capture points manually by using the following controls:

ItemDescription
Icons general addClick this icon to configure a new capture point. Fill in the following information:
  • Capture class name: enter the name of the class at the top of the stack trace you want to capture.

  • Capture method name: enter the name of the method at the top of the stack trace you want to capture.

  • Capture key expression: enter the capture key expression. The capture key expression is evaluated and the value is used as the key.

  • Insert class name: enter the name of the class where you want to insert the captured stack trace.

  • Insert method name: enter the name of the method where you want to insert the captured stack trace.

  • Insert key expression: enter the key expression that will be evaluated and this value will be matched with the key in the captured stack.

Use the checkbox next to each entry to enable/disable the selected capture point.

Icons general removeClick this icon to remove the capture point from the list.
Icons actions previous occurenceIcons actions next occurenceClick these icons to move the selected item one line up or down in the list.
Enable selectedDisable selectedClick these icons to enable/disable all selected capture points.
Icons actions copyClick this icon to duplicate the selected entry.
Import capture settingsClick this icon to import capture point settings from a file.
Icons toolbar decorator exportClick this icon to export capture point settings to a file.
Capture local variablesSelect this option if you also want to capture local variables (primitives and String values) together with the call stack. This may sufficiently slow down the debugging process.

Note that this option is unavailable if the Instrumenting agent is enabled

Last modified: 08 March 2021