AppMap for JetBrains

AppMap tool window

The AppMap tool window shows all AppMap Diagrams in your open projects. You can open it from the top level menu (View -> Tools Windows -> AppMaps), with an AppMap action or by clicking on its tab in the UI.

AppMap tool window actions:

  • Alphabetical listing of all AppMap Diagrams in the project, sorted by name.
  • Double-click on any AppMap to open it.
  • Search for an AppMap by its name.
  • Start/stop remote recordings.
  • View the Quickstart guide.

“Start with AppMap” for Java

This section only applies to Java applications.

Installing the AppMap JetBrains plugin adds custom buttons and menu options to the JetBrains editor interface. These can be used to run your Java application code with AppMap automatically configured, saving you from manually changing your Maven or Gradle settings. This is the recommended approach for all Java users using JetBrains editors like IntelliJ.

For example, if you right click on your main class file you’ll see a new menu item under “More Run/Debug” to Start with AppMap. Selecting this option will start your application with the AppMap libraries enabled. From here, you can interact with your application to generate request recordings or use remote recording

You can also use this custom button to run a specific test or group of tests with the Start with AppMap option. Similar to above, right click on a single test or a group of tests and use the custom button under “More Run/Debug” to Start with AppMap.

“Start with AppMap” button

Use the “Start with AppMap” button to start your run configurations with AppMap enabled.

For JetBrains versions 2024.1 and earlier the “Start with AppMap” button is in the main toolbar.

For JetBrains versions 2024.2 and later the “Start with AppMap” button is located in a dropdown menu, accessible by clicking on the vertical dots.

Demo video: Recording AppMap Data from a Java application

Create AppMap Data from JUnit test runs

  1. Install the JetBrains plugin if you haven’t already.
  2. Open your test file in the editor. Each method marked with JUnit’s @Test annotation will produce an AppMap.
  3. Run the test(s) with AppMap by clicking the icon next to the test class and then selecting “Start with AppMap”, or by clicking the AppMap run configuration button:

Disable specific JUnit tests

To disable recording for a particular JUnit test (for example, a performance test), list the class or methods under exclude in the project’s appmap.yml configuration file.

Running a Java application with AppMap

When you run a Java application with the AppMap agent, remote recording will be enabled. (Note: For this to work, your application must include a web server).

  1. Install the JetBrains plugin if you haven’t already.
  2. Open your application file in the editor.
  3. Run your application with AppMap by clicking the icon next to the main class you wish to run and then selecting “Start with AppMap”, or by clicking the AppMap run configuration button:
  4. With the application running, follow the remote recording instructions below to (starting at step 3) create AppMap Data.

Remote recording

You can make a remote recording from within the JetBrains IDE.

  1. Install the JetBrains plugin if you haven’t already.
  2. Start your application with remote recording enabled. For Java, run your Java application with AppMap. For other languages, consult the agent reference for details.
  3. To start a recording, click the remote recording button, or use the command Start AppMap recording.
  4. Enter the URL where your application is running.
  5. Interact with your app through its UI or API. Then click the button to stop the recording, or use the command Stop AppMap recording.
  6. You’ll be prompted to save the AppMap to a file, and it will be opened.

For more details about remote recording, see:

AppMap Plugin actions

To open the list of AppMap plugin actions, press CTRL+SHIFT+A on Windows and Linux, or COMMAND+SHIFT+A on macOS, and type AppMap. You can also find these actions at Tools > AppMap of the main menu.

The command names should be self-explanatory.

Generate OpenAPI Definitions

After recording AppMap Data for your project, select “Generate OpenAPI” from the AppMap instructions quick start in the lower right hand column.

Generate OpenAPI Link

Selecting the “Generate OpenAPI Definitions” button will open a new file with your OpenAPI definition document to save locally, share with your team or use with 3rd party API management tools like Postman

OpenAPI Generation Screen

Troubleshooting

Enable Debug Logging

You can enable debug logging of the AppMap plugin in your JetBrains code editor by first opening Help > Diagnostic Tools > Debug Log Settings.

JetBrains Debug Log menu

In the Custom Debug Log Configuration enter appland to enable DEBUG level logging for the AppMap plugin.

JetBrains Debug Log Configuration

Next, open Help > Show Log... will open the IDE log file.

JetBrains Debug Show Log

Downloading Plugin Logs

AppMap technical support may ask you for your IDE logs to diagnose issues with the plugin’s behavior. If so, go to the Help menu in your editor and select Collect Logs and Diagnostic Data. This will create a .zip file on your local machine and open a file explorer window to it. You can then safely send that file to AppMap within your technical support ticket conversation.

GitHub Repository

https://github.com/getappmap/appmap-intellij-plugin


Was this page helpful? thumb_up Yes thumb_down No
Thank you for your feedback!