diff --git a/config/_default/menus/main.en.yaml b/config/_default/menus/main.en.yaml index 1b7c272797894..0bcc852b80d14 100644 --- a/config/_default/menus/main.en.yaml +++ b/config/_default/menus/main.en.yaml @@ -1097,16 +1097,21 @@ menu: parent: ide_plugins identifier: ide_plugins_idea weight: 701 - - name: Live Debugger - url: developers/ide_plugins/idea/live_debugger/ - parent: ide_plugins_idea - identifier: ide_plugins_idea_debugger - weight: 7011 - name: Logs url: developers/ide_plugins/idea/logs/ parent: ide_plugins_idea identifier: ide_plugins_idea_logs + weight: 7011 + - name: Live Debugger + url: developers/ide_plugins/idea/live_debugger/ + parent: ide_plugins_idea + identifier: ide_plugins_idea_debugger weight: 7012 + - name: Code Security + url: developers/ide_plugins/idea/code_security/ + parent: ide_plugins_idea + identifier: ide_plugins_idea_code_security + weight: 7013 - name: VS Code & Cursor url: developers/ide_plugins/vscode/ parent: ide_plugins diff --git a/content/en/developers/ide_plugins/idea/_index.md b/content/en/developers/ide_plugins/idea/_index.md index 516df8f9ef572..96f024c93a7d5 100644 --- a/content/en/developers/ide_plugins/idea/_index.md +++ b/content/en/developers/ide_plugins/idea/_index.md @@ -6,21 +6,21 @@ aliases: - '/developers/ide_integrations/idea/' - '/developers/ide_plugins/idea/continuous_profiler/' further_reading: -- link: "/tracing/live_debugger/" +- link: "/tracing/error_tracking/" tag: "Documentation" - text: "Learn about Live Debugger" + text: "Learn more about Error Tracking" - link: "/logs/explorer/" tag: "Documentation" - text: "Learn about Logs" -- link: "/integrations/guide/source-code-integration/" + text: "Learn more about Logs" +- link: "/tracing/live_debugger/" tag: "Documentation" - text: "Learn about Source Code Integration." -- link: "/static_analysis/?tab=githubactions" + text: "Learn more about Live Debugger" +- link: "/security/code_security/" + tag: "Documentation" + text: "Learn more about Code Security" +- link: "/integrations/guide/source-code-integration/" tag: "Documentation" - text: "Learn about Static Analysis." -- link: "https://www.datadoghq.com/blog/datadog-ide-plugins/" - tag: "Blog" - text: "Reduce context switching while troubleshooting with Datadog's IDE plugins" + text: "Learn more about Source Code Integration" --- {{% site-region region="gov" %}} @@ -31,128 +31,124 @@ further_reading: ## Overview -The Datadog plugin for JetBrains IDEs helps improve software performance by providing code insights in the IDE based on real-time observability data. The plugin is for developers that use Datadog products including [Error Tracking][6], [Live Debugger][21], [Logs][23], [Code Security][7], [Test Optimization][18] and [CI Visibility][19] to monitor their services. It is available for IntelliJ IDEA, GoLand, PyCharm, WebStorm, and PhpStorm. +The Datadog plugin for JetBrains IDEs helps improve software performance by providing code insights in the IDE based on real-time observability data. The plugin is for developers that use Datadog products including [Error Tracking][6], [Logs][23], [Live Debugger][21] and [Code Security][24] to monitor their services. It is available for IntelliJ IDEA, GoLand, PyCharm, WebStorm, and PhpStorm. {{< img src="/developers/ide_plugins/idea/overview1.png" alt="The Datadog tool window open in IDEA" style="width:100%;" >}} -The **Code Insights** feature helps you find and fix runtime errors from [Error Tracking][6], library and runtime code vulnerabilities from [Code Security][7], flaky tests detected by [Test Optimization][18], and more. +## Core features -The [**Live Debugger**][20] enables you to capture vital debugging information by adding temporary logs to your runtime code and without having to stop and restart your service or application. +### Error Tracking +The [**Error Tracking**][6] integration helps you find and fix runtime errors from Error Tracking. -The [**Logs**][23] integration shows observed logs in the source code editor and provides links to the [Log Explorer][5] to view logs generated by a specific line of code. +{{< img src="/developers/ide_plugins/idea/error-tracking-in-editor.png" alt="Error tracking in the source editor" style="width:100%;" >}} -The **CI Test Runs** feature opens the [CI Visibility Explorer][9] to show recent runs for any test. +Click the inlay to open the Datadog tool-window and inspect details of the runtime error. -The **Static Analysis** engine, running locally, analyzes your code against predefined rules to detect and fix problems before you commit changes. +### Logs -## Requirements +The [Logs][23] integration detects log lines in your source code, displays live event counts directly in the source editor, and provides links to the Datadog Log Explorer to view the logs generated by each log line. -- **A Datadog account**: The plugin requires a Datadog account (except when using [Static Analysis][13] features). If you're new to Datadog, go to the [Datadog website][3] to learn more about Datadog's observability tools and sign up for a free trial. +{{< img src="/developers/ide_plugins/idea/logs/logs.png" alt="Log events from Datadog" style="width:100%;" >}} -## Setup +Find out more in the [Logs][23] sub-section. -### Install the Datadog plugin +### Live Debugger -1. Click **Plugins** and search for `Datadog`. -1. Click **Install** to download and install the plugin in your IDE. -1. If you receive a prompt notifying you that Datadog is a third-party plugin, click **Accept**. -1. Click **Restart IDE**. +The [**Live Debugger**][20] enables you to add logpoints—auto-expiring, non-breaking breakpoints—to your runtime code to collect information for debugging. -{{< img src="/developers/ide_plugins/idea/install-plugin.png" alt="The Datadog plugin" style="width:100%;" >}} +{{< img src="/developers/ide_plugins/idea/live_debugger/tool-window-tab.png" alt="The Live Debugger tab" style="width:100%;" >}} -Alternatively, you can install the plugin from the [JetBrains Marketplace][4]. +Find out more in the [Live Debugger][20] sub-section. - +### Code Security +The [**Code Security**][24] integration promotes better security by: -### Log in to Datadog +- flagging library vulnerabilities and runtime code vulnerabilities +- checking your code changes locally, as you edit, to detect quality and security issues prior to commit -After installing the Datadog plugin and restarting the IDE, log in to Datadog: -1. With a file or project open in the IDE, click the **Datadog** tool window. -1. Click **Log in...**. -1. In the browser window that opens, select your site and organization, then authorize access to the platform. +{{< img src="/developers/ide_plugins/idea/code_security/library-vulnerability.png" alt="A library vulnerability highlighted in the source editor." style="width:80%;" >}} -**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. +Find out more in the [Code Security][24] sub-section. -### Link a service +## Other features -To provide relevant data from the Datadog platform, add related services to your project: -1. With your project open in the IDE, open the **Datadog** tool window and select **Manage Linked Services...** from the **Options** menu. -1. A settings dialog opens, click the plus icon (**+**). -1. Search for and select the services that you want to add to the current project. +### View in IDE -To remove a service, select it in the **Services** table and click the minus icon (**-**). +The **View in IDE** feature provides a link from the Datadog platform directly to the source files in your IDE. Look for the button next to frames in stack traces displayed on the platform (for example, in [Error Tracking][6]): -
The names of linked services persist with the project when you close it.
+{{< img src="/developers/ide_plugins/idea/view-in-idea.png" alt="A stack trace on the Datadog platform showing the View in IntelliJ button." style="width:100%;" >}} -## Code Insights -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. +
A prerequisite to make the most of this feature is that Source Code Integration is configured for your service.
-{{< img src="/developers/ide_plugins/idea/code-insights-2.png" alt="The Code Insights tab." style="width:100%;" >}} +### Code Origin for Spans +The [**Code Origin for Spans**][22] integration shows you metrics for entry spans at the corresponding location in your source code. -Code Insights include a detailed description for each issue, and links to: -- The related source code location -- The Datadog platform for additional information +{{< img src="/developers/ide_plugins/idea/apm-span.png" alt="APM spans in the source editor" style="width:80%;" >}} -You can dismiss individual insights and set filters to view the categories of insights that you are interested in. +Click the inlay to open the Datadog tool-window and inspect the span details. -## Live Debugger +### Flaky Tests +The [**Flaky Tests**][7] integration shows you flaky tests detected by [Test Optimization][2]. -The [**Live Debugger**][20] enables you to add logpoints—auto-expiring, non-breaking breakpoints—to your runtime code to collect information for debugging. +{{< img src="/developers/ide_plugins/idea/flaky-test-in-editor.png" alt="APM spans in the source editor" style="width:80%;" >}} -{{< img src="/developers/ide_plugins/idea/live_debugger/tool-window-tab.png" alt="The Live Debugger tab" style="width:100%;" >}} +Click the inlay to open the Datadog tool-window and inspect the test details. -Find out more in the [Live Debugger][20] subsection. +### CI Test Runs +You can view recent test runs in the [CI Visibility Explorer][12] by navigating directly from your source files. Look for the **CI Test Run** inlays above test method declarations in your source code: -## Logs +{{< img src="/developers/ide_plugins/idea/ci-test-in-editor.png" alt="A source file showing a CI Test Run inlay." style="width:80%;" >}} -The [Logs][23] integration detects log lines in your source code, displays live event counts directly in the source editor, and provides links to the Datadog Log Explorer to view the logs generated by each log line. +Clicking the link opens the **Test Runs** tab showing the recent history for one test case. -{{< img src="/developers/ide_plugins/idea/logs/logs.png" alt="Log events from Datadog" style="width:100%;" >}} +## Requirements -Find out more in the [Logs][23] sub-section. +- **A Datadog account**: The plugin requires a Datadog account (except when using [Static Analysis][13] features). If you're new to Datadog, go to the [Datadog website][3] to learn more about Datadog's observability tools and sign up for a free trial. -## CI Test Runs -You can view recent test runs in the [CI Visibility Explorer][12] by navigating directly from your source files. Look for the **CI Test Run** inlays above test method declarations in your source code: +## Setup -{{< img src="/developers/ide_plugins/idea/ci-navigation.png" alt="A source file showing a CI Test Run inlay." style="width:100%;" >}} +### Install the Datadog plugin -Clicking the link opens the **Test Runs** tab showing the recent history for one test case. +1. Click **Plugins** and search for `Datadog`. +1. Click **Install** to download and install the plugin in your IDE. +1. If you receive a prompt notifying you that Datadog is a third-party plugin, click **Accept**. +1. Click **Restart IDE**. -## View in IDE +{{< img src="/developers/ide_plugins/idea/install-plugin.png" alt="The Datadog plugin" style="width:100%;" >}} -The **View in IDE** feature provides a link from the Datadog platform directly to the source files in your IDE. Look for the button next to frames in stack traces displayed on the platform (for example, in [Error Tracking][6]): +Alternatively, you can install the plugin from the [JetBrains Marketplace][4]. -{{< img src="/developers/ide_plugins/idea/view-in-idea.png" alt="A stack trace on the Datadog platform showing the View in IntelliJ button." style="width:100%;" >}} + -
A prerequisite to make the most of this feature is that Source Code Integration is configured for your service.
+### Log in to Datadog -## Static Analysis -The Datadog plugin runs [Static Analysis][13] rules on your source files as you edit them. The goal is to detect and fix problems such as maintainability issues, bugs, or security vulnerabilities in your code before you commit your changes. +After installing the Datadog plugin and restarting the IDE, log in to Datadog: +1. With a file or project open in the IDE, click the **Datadog** tool window. +1. Click **Log in...**. +1. In the browser window that opens, select your site and organization, then authorize access to the platform. -Static Analysis supports scanning for many programming languages. For a complete list, see [Static Analysis Rules][14]. For file types belonging to supported languages, issues are shown in the source code editor with the JetBrains inspection system, and suggested fixes can be applied directly: +**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. -{{< img src="/developers/ide_plugins/idea/static-analysis-issue.png" alt="A static analysis rule violation and recommended fix." style="width:100%;" >}} +### Link a service -Additionally, all issues detected by this feature are listed in the standard **Problems** view. +To provide relevant data from the Datadog platform, add related services to your project: +1. With your project open in the IDE, open the **Datadog** tool window and select **Manage Linked Services...** from the **Options** menu. +1. A settings dialog opens, click the plus icon (**+**). +1. Search for and select the services that you want to add to the current project. -### Getting started -When you start editing a source file supported by Static Analysis, the plugin checks for `static-analysis.datadog.yml` at your source repository's root. It prompts you to create the file if necessary: +To remove a service, select it in the **Services** table and click the minus icon (**-**). -{{< img src="/developers/ide_plugins/idea/static-analysis-onboard.png" alt="A banner for onboarding." style="width:100%;" >}} +
The names of linked services persist with the project when you close it.
-Once the configuration file is created, the static analyzer runs automatically in the background. +## Data and telemetry +Datadog collects information about your usage of this IDE, including how you interact with it, whether errors occurred while using it, and what caused those errors, in accordance with the [Datadog Privacy Policy][16] and [Datadog's EULA][17]. -
The Static Analysis feature does not require a Datadog account as source files are analyzed locally.
+If you don't wish to send this data to Datadog, you can disable the collection at any time in the settings: `Settings > Tools > Datadog > Data Sharing` and disable the `Send usage statistics` option. ## Feedback You can give feedback in the [discussion forum][1], or send an e-mail to [team-ide-integration@datadoghq.com][11]. -## Data and Telemetry -Datadog collects information about your usage of this IDE, including how you interact with it, whether errors occurred while using it, and what caused those errors, in accordance with the [Datadog Privacy Policy][16] and [Datadog's EULA][17]. - -If you don't wish to send this data to Datadog, you can disable the collection at any time in the settings: `Settings > Tools > Datadog > Data Sharing` and disable the `Send usage statistics` option. - ## Further reading {{< partial name="whats-next/whats-next.html" >}} @@ -164,11 +160,12 @@ If you don't wish to send this data to Datadog, you can disable the collection a [1]: https://github.com/DataDog/datadog-for-intellij/discussions +[2]: /tests/ [3]: https://www.datadoghq.com/ [4]: https://plugins.jetbrains.com/plugin/19495-datadog [5]: /logs/explorer/ [6]: /tracing/error_tracking/ -[7]: /security/code_security/ +[7]: /tests/flaky_tests [8]: /security/code_security/software_composition_analysis/ [9]: /continuous_integration/explorer/ [11]: mailto:team-ide-integration@datadoghq.com @@ -182,4 +179,6 @@ If you don't wish to send this data to Datadog, you can disable the collection a [19]: /continuous_integration/ [20]: /developers/ide_plugins/idea/live_debugger/ [21]: /tracing/live_debugger/ -[23]: /developers/ide_plugins/idea/logs/ \ No newline at end of file +[22]: /tracing/code_origin?tab=java +[23]: /developers/ide_plugins/idea/logs/ +[24]: /developers/ide_plugins/idea/code_security/ \ No newline at end of file diff --git a/content/en/developers/ide_plugins/idea/code_security.md b/content/en/developers/ide_plugins/idea/code_security.md new file mode 100644 index 0000000000000..83ce681d82436 --- /dev/null +++ b/content/en/developers/ide_plugins/idea/code_security.md @@ -0,0 +1,78 @@ +--- +title: Code Security +type: documentation +further_reading: +- link: "/security/code_security/" + tag: "Documentation" + text: "Learn more about Code Security" +--- + +## Overview +The [Code Security][4] integration in the plugin promotes better security by: + +- flagging library vulnerabilities and runtime code vulnerabilities +- checking your code changes locally, as you edit, to detect quality and security issues prior to commit + +The feature is supported for any source code repository that is onboarded for [Datadog Code Security][1]. + +## Vulnerabilities +The Datadog plugin reports library and runtime code vulnerabilities highlighting the issues directly in your source editor: + +{{< img src="/developers/ide_plugins/idea/code_security/library-vulnerability.png" alt="A library vulnerability highlighted in the source editor" style="width:80%;" >}} + +Full details of each vulnerability are shown in the Datadog tool-window in the **File Insights** and **Project Insights** tabs. + +{{< img src="/developers/ide_plugins/idea/code_security/library-vulnerability-tool-window.png" alt="A library vulnerability shown in the Datadog tool-window" style="width:100%;" >}} + +Click on the link in the `Code Links` section to navigate to the source location, or click on the vulnerability description to open the summary at Datadog. + +## Local code analysis + +### File editing +As you edit your source files, the Datadog plugin checks the content (locally) against a set of [rules][2] to detect and flag quality and security issues before you commit your changes. + +The local analysis engine supports all the file types listed in [Static Analysis Rules][3]. Issues are shown in the source code editor with the JetBrains inspection system, and suggested fixes can be applied directly: + +{{< img src="/developers/ide_plugins/idea/code_security/local-code-analysis.png" alt="Static analysis violation in the source editor" style="width:100%;" >}} + +Additionally, all issues detected by this feature are listed in the standard **Problems** view. + +### Analyzing multiple files +You can run the local code analysis across multiple files. In the **Code** menu, select **Analyse Code** → **Run Inspection By Name…** and choose `Datadog Static Analysis`: + +{{< img src="/developers/ide_plugins/idea/code_security/inspection-by-name.png" alt="Datadog Static Analysis inspection" style="width:60%;" >}} + +Choose the scope, click **OK**, then review the flagged issues in the **Problems** view. + +### Configuration +The code analyzer will run automatically if: + +1. your repository has been onboarded for [Datadog Code Security][1] +2. you are logged in to Datadog so that the remote configuration data is available + +To see the configuration data in your IDE, run the action **Show Datadog Static Analyzer Config**: + +{{< img src="/developers/ide_plugins/idea/code_security/show-sa-config.png" alt="Action to show the Static Analyzer configuration" style="width:80%;" >}} + +A local configuration file (`static-analysis.datadog.yml`) can be placed at the root of the repository and will be merged with the remote configuration. When there is no remote configuration available, the local configuration file will be used on its own. + +
Using a local configuration file is a great way to try out the feature and works even without a Datadog login.
+ +{{< img src="/developers/ide_plugins/idea/code_security/local-config.png" alt="A local configuration file for Static Analysis" style="width:100%;" >}} + +Read more about how to [customize your configuration][5]. + +### Settings +The Datadog Static Analyzer can be activated and deactivated in the IDE settings under **Editor** → **Inspections**. + +{{< img src="/developers/ide_plugins/idea/code_security/inspections-settings.png" alt="Settings to activate and deactivate Static Analysis" style="width:80%;" >}} + +## Further reading + +{{< partial name="whats-next/whats-next.html" >}} + +[1]: https://app.datadoghq.com/security/configuration/code-security/setup +[2]: /security/code_security/static_analysis/setup/?tab=github +[3]: /security/code_security/static_analysis/static_analysis_rules/ +[4]: /security/code_security/ +[5]: /security/code_security/static_analysis/setup/?tab=github#customize-your-configuration \ No newline at end of file diff --git a/static/images/developers/ide_plugins/idea/apm-span.png b/static/images/developers/ide_plugins/idea/apm-span.png new file mode 100644 index 0000000000000..2503f039fb679 Binary files /dev/null and b/static/images/developers/ide_plugins/idea/apm-span.png differ diff --git a/static/images/developers/ide_plugins/idea/ci-test-in-editor.png b/static/images/developers/ide_plugins/idea/ci-test-in-editor.png new file mode 100644 index 0000000000000..0c3bb819c6ae3 Binary files /dev/null and b/static/images/developers/ide_plugins/idea/ci-test-in-editor.png differ diff --git a/static/images/developers/ide_plugins/idea/code_security/inspection-by-name.png b/static/images/developers/ide_plugins/idea/code_security/inspection-by-name.png new file mode 100644 index 0000000000000..2ce82c97f8ec2 Binary files /dev/null and b/static/images/developers/ide_plugins/idea/code_security/inspection-by-name.png differ diff --git a/static/images/developers/ide_plugins/idea/code_security/inspections-settings.png b/static/images/developers/ide_plugins/idea/code_security/inspections-settings.png new file mode 100644 index 0000000000000..3f1f1485d13cb Binary files /dev/null and b/static/images/developers/ide_plugins/idea/code_security/inspections-settings.png differ diff --git a/static/images/developers/ide_plugins/idea/code_security/library-vulnerability-tool-window.png b/static/images/developers/ide_plugins/idea/code_security/library-vulnerability-tool-window.png new file mode 100644 index 0000000000000..9028cd94e9e91 Binary files /dev/null and b/static/images/developers/ide_plugins/idea/code_security/library-vulnerability-tool-window.png differ diff --git a/static/images/developers/ide_plugins/idea/code_security/library-vulnerability.png b/static/images/developers/ide_plugins/idea/code_security/library-vulnerability.png new file mode 100644 index 0000000000000..0552fa3a0f1fd Binary files /dev/null and b/static/images/developers/ide_plugins/idea/code_security/library-vulnerability.png differ diff --git a/static/images/developers/ide_plugins/idea/code_security/local-code-analysis.png b/static/images/developers/ide_plugins/idea/code_security/local-code-analysis.png new file mode 100644 index 0000000000000..d3cf08effa5c1 Binary files /dev/null and b/static/images/developers/ide_plugins/idea/code_security/local-code-analysis.png differ diff --git a/static/images/developers/ide_plugins/idea/code_security/local-config.png b/static/images/developers/ide_plugins/idea/code_security/local-config.png new file mode 100644 index 0000000000000..90976fe966b74 Binary files /dev/null and b/static/images/developers/ide_plugins/idea/code_security/local-config.png differ diff --git a/static/images/developers/ide_plugins/idea/code_security/show-sa-config.png b/static/images/developers/ide_plugins/idea/code_security/show-sa-config.png new file mode 100644 index 0000000000000..25090d1da4f0f Binary files /dev/null and b/static/images/developers/ide_plugins/idea/code_security/show-sa-config.png differ diff --git a/static/images/developers/ide_plugins/idea/error-tracking-in-editor.png b/static/images/developers/ide_plugins/idea/error-tracking-in-editor.png new file mode 100644 index 0000000000000..3eb98dc94ea0a Binary files /dev/null and b/static/images/developers/ide_plugins/idea/error-tracking-in-editor.png differ diff --git a/static/images/developers/ide_plugins/idea/flaky-test-in-editor.png b/static/images/developers/ide_plugins/idea/flaky-test-in-editor.png new file mode 100644 index 0000000000000..2e60c19889a0e Binary files /dev/null and b/static/images/developers/ide_plugins/idea/flaky-test-in-editor.png differ diff --git a/static/images/developers/ide_plugins/idea/static-analysis-onboard.png b/static/images/developers/ide_plugins/idea/static-analysis-onboard.png deleted file mode 100644 index 1414180e8fbd1..0000000000000 Binary files a/static/images/developers/ide_plugins/idea/static-analysis-onboard.png and /dev/null differ