Datadog Plugin for the IntelliJ Platform
The Datadog plugin for the IntelliJ Platform (IDEA and GoLand) helps you to improve software performance by providing meaningful code-level insights in the IDE based on real-time observability data.
The Code Insights view keeps you informed about:
The Continuous Profiler helps you to reduce latency and lower cloud costs by highlighting code lines that:
- Consume the most CPU
- Allocate the most memory
- Spend the most time on locks, disk I/O, and socket I/O
The Logs Navigation support opens the Datadog Log Explorer with a view matching the context in which you are working.
- A Datadog account: The plugin requires a Datadog account. If you’re new to Datadog, go to the Datadog website to learn more about Datadog’s observability tools and sign up for a free trial.
- Continuous Profiler: To display profiling data and insights, the plugin requires the Continuous Profiler to be configured for your Services. For more information, see Getting Started with the Continuous Profiler.
- JetBrains Toolbox: To use the View in IDE feature, the plugin requires the JetBrains Toolbox to be installed on the developer’s machine.
Install the Datadog plugin
- Click Plugins and search for
- Click Install to download and install the plugin in your IDE.
- If you receive a prompt notifying you that Datadog is a third-party plugin, click Accept.
- Click Restart IDE.
Alternatively, you can install the plugin from the JetBrains Marketplace.
Log in to Datadog
After installing the Datadog plugin and restarting the IDE, log in to Datadog:
- With a file or project open in the IDE, click the Datadog tool window.
- Click Log in….
- In the browser window that opens, select your site and organization, then authorize access to the platform.
Note: For most users, one login is all that is required. If you’re using a multi-org setup, check to ensure that the correct account is active. To find out which login your IDE is using, click Settings -> Tools -> Datadog, and check which account is active.
Link a service
To provide relevant data from the Datadog platform, add related services to your project:
- With your project open in the IDE, open the Datadog tool window and select Manage Linked Services… from the Options menu.
- A settings dialog opens, click the plus icon (+).
- Search for and select the services that you want to add to the current project.
To remove a service, select it in the Services table and click the minus icon (-).
The names of linked services persist with the project when you close it.
The Code Insights tab displays insights generated by the Datadog platform that are relevant to your current project. The insights are grouped into three categories: performance, reliability, and security.
Code Insights include a detailed description for each issue, and links to:
- The related source code location
- The Datadog platform for additional information
You can dismiss individual insights and set filters to view the categories of insights that you are interested in.
The Continuous Profiler tab shows profiling information for the service in a selected environment, aggregated over a specific time frame. Available views are:
- Top list: Displays a list of the most resource intensive methods for the current profiling measure.
- Flame graph: A flame graph representing stack traces in the profiles.
You can specify the following parameters for the profiling data:
- The profile type to be displayed
- The environment in which the service is running
- The time frame for the profile samples to be aggregated
The available profiling types usually include options like CPU Time and Allocated Memory, but are determined by the platform and vary by language.
The Top List sub-tab shows the methods that consume the most resources based on the aggregated profile data loaded from the Datadog servers. Top List is designed to show a summary of the methods that are most likely to be interesting from a resource consumption point of view.
- Double-clicking an item in the list (or selecting Jump to Source from the context menu) opens a source code editor showing where the method is defined.
- To see a flame graph visualization of a method, select Search in Flame Graph from the context menu.
The call tree to the right of the Top List shows the paths that lead to (and from) the selected method.
The default Caller Hierarchy view shows the callers (or predecessors) of the target method and the frequency with which they appear in the call stack. To view the callees (or successors), click the Callee Hierarchy button on the toolbar.
Right-click on a method in the call tree to see options to navigate to the source editor or flame graph.
A flame graph is a visualization of profiling samples that shows stack traces and their relative frequency during the sample period. The Datadog plugin collects multiple individual profiles from the requested time frame, and aggregates them. Each individual profile covers a 60 second interval within the requested time frame.
Each time you change the profile type, the time frame, or the environment, the Datadog plugin generates a new flame graph.
You can navigate the flame graph in several ways:
- Double-click on any frame to focus on that method and all the methods that it has called during the sampling period.
- Use the minimap to pan around the graph.
- Right-click on a method and select Jump to Source to go to the corresponding point in the source code.
Hovering over a method displays a tooltip with the following information:
- The class name and method signature
- The package name
- The profiling metric value and percentage breakdown.
Profiling samples include stack trace and line number information. Use the Separate Flame Graph by button to switch between separating frames by method or line number.
When the Continuous Profiler tab is active, the plugin adds code highlights to the source code editor margin. For Top Methods, an icon appears in the editor margin, and line-level highlights appear in the code based on the active Profiling data.
- Hover over the icon to see more information.
- Click the icon to open the top list Profiling tab or open Profiling in Datadog.
The active Profiling tab also affects the project tree view, which is annotated with the selected profile’s metrics:
You can navigate to the Log Explorer on the Datadog platform directly from your Java or Go source files. Look for the View Logs links following the log statements in your source code:
Clicking the link opens the Log Explorer with a query that matches the logger name, log level, and log message as closely as possible.
View in IDE
The View in IntelliJ IDEA feature provides a link from the Datadog platform directly to your Java source files (not yet available for Go). Look for the button next to frames in stack traces displayed on the platform (for example, in Error Tracking):
This feature has two prerequisites: (1) Source Code Integration is configured for your service and (2) the JetBrains Toolbox is installed on your development machine.
You can give feedback in the discussion forum, or send an e-mail to email@example.com.
Additional helpful documentation, links, and articles: