Datadog for VS Code & CursorOverviewThe Datadog extension for VS Code and Cursor brings Datadog to your code editor to accelerate your development.
The extension includes these features:
Requirements
MCP Server setupThe extension includes access to the Datadog Model Context Protocol (MCP) Server. Enable the MCP Server to enhance your IDE's AI capabilities with your specific Datadog environment. In CursorInstall the Datadog Cursor Plugin from the Cursor marketplace. The plugin configures the Datadog MCP Server in Cursor automatically. In VS Code
Log annotationsUse Log Annotations to gauge the volume of logs generated by a given log line in your code. The extension adds annotations above your code to detected logging patterns that match log records in Datadog. Click an annotation to open the Log Explorer in Datadog and view the matching logs. You can also search Datadog logs from within VS Code. Select any text in the code editor, then right-click and select Datadog > Search Logs With Selected Text. ![]() Code InsightsCode insights keep you informed with Datadog-generated insights that are relevant to your code base:
The extension identifies errors and vulnerabilities in the code with colored squiggles; hover over the line for more details. The Code Insights view in the Datadog sidebar lists all the issues found in the repository. Select an item to view the full insight, and use the links to jump to the related source code location or open the code insight in Datadog. You can group code insights by kind, file, priority, or service. You can also ignore individual code insights and set filters to view the ones you're most interested in. ![]() For specific insights about the file currently open in the active editor, check the File Insights view in the IDE's file explorer. This view also lists issues discovered by Code Security within the file. View in IDE
The View in VS Code or View in Cursor feature provides a link from Datadog directly to your source files. Look for the button next to frames in stack traces displayed in the UI (for example, in Error Tracking): ![]() You can also use this feature to open your source files from an insight (such as an error from Error Tracking): ![]()
Code SecurityThe Code Security features analyze your code locally to detect and fix security issues and vulnerabilities before you commit your changes. The extension supports two complementary scan types: Static Code Analysis and Secret Scanning. Static Code AnalysisStatic Code Analysis analyzes your source files against predefined rules to catch security vulnerabilities, bugs, and maintainability issues. The extension runs Static Code Analysis rules on the source files you have open in your workspace. Static Code Analysis supports scanning for many programming languages. For a complete list, see Static Code Analysis Rules. Issues are shown in the source code editor, and you can directly apply suggested fixes. Get started with Static Code AnalysisWhen you start editing a source file, the extension checks for ![]() After you create the configuration file, the analyzer runs automatically in the background whenever you open a file. If you need to enable Static Code Analysis for a particular language, search for the command You can also run a batch analysis for individual folders and even the entire workspace. In the IDE's file explorer view, right-click a folder and select Datadog Code Security > Analyze Folder or Analyze Workspace. Rule editorWrite and test custom Static Code Analysis rules without leaving your IDE. Use the Datadog DDSA Rule Editor to design detection logic for internal standards, security patterns, or maintainability checks specific to your codebase. To open the rule editor, run the ![]() Secret ScanningSecret Scanning detects exposed credentials — API keys, tokens, and passwords — in your source files before you commit them. File contents are scanned locally against rules fetched from your Datadog organization, and findings appear in the editor as you type. Secret Scanning is enabled by default and runs in the background whenever you open a source file. No local configuration is required — scan rules are fetched from the Datadog backend. All text files are scanned; binary files are skipped automatically. You can also scan an entire folder or workspace at once. In the IDE's file explorer view, right-click a folder and select Datadog Code Security > Analyze Folder or Analyze Workspace.
Review findingsDetected secrets are shown in three places:
Suppress a findingTo suppress an individual detection, use the code action for the flagged secret to insert a Turn Secret Scanning on or offTo toggle Secret Scanning, run the Exception ReplayException Replay allows you to inspect the stack trace frames of any Error Tracking code insight and get information about the values of the variables of the code running in production. To access this feature, you must enable Error Tracking Exception Replay on Datadog. After the feature has been enabled, you can see an Exception Replay button next to the stack trace section of any instrumented Error Tracking code insight. Click the button to:
Select an Error Tracking code insight from the Code Insights view. Go to the stack trace and click the Exception Replay button. The IDE shows a new activity with two new views:
Select a stack trace frame and inspect the values of all the variables that Datadog captured from your production code. Live DebuggerThe Live Debugger lets you add logpoints — auto-expiring, non-breaking breakpoints — to your running services to collect information for debugging. Logpoints are set dynamically, so you don't need to redeploy your code to investigate an issue. Logpoints are grouped into sessions, and you can activate, edit, deactivate, or delete sessions (or individual logpoints) at any time. All sessions and logpoints automatically deactivate after 60 minutes, and log events are rate-limited to one execution per second. To use this feature, your service must be set up for Datadog Dynamic Instrumentation, and remote code is matched to your local files using Source Code Integration. The Datadog Live Debugger activityThe extension contributes a dedicated Datadog Live Debugger activity to the IDE sidebar, with the following views:
Source editor integrationFor lines that have a logpoint defined in the current session, the extension shows a status icon in the editor gutter and a code lens above the line, and lets you act on the logpoint from the line-number context menu:
Creating a logpointTo add a logpoint, right-click the line number for a line of code in the source editor and select Datadog Live Debugger > Create Logpoint. The logpoint is added to the current session, or a new session is created if needed. The Logpoint Editor webview shows the following fields:
The editor warns you when no service or environment matches the file's language, or when the remote service is associated with a different repository than the local workspace — you can still create the logpoint in those cases. Local and remote versionsThe remote running code may be a different revision compared to the source you are editing. The extension uses Git commit information to map line numbers from your local file to the remote revision, so logpoints land on the correct line even if the remote is on a different commit. This requires your service to be tagged with Git information.
Editing, enabling, disabling, and deleting
The gutter icon reflects the current status of each logpoint:
Generate a unit test from a log eventFrom the Log Events view, the Generate Unit Test action sends the runtime values captured by a logpoint (variables and arguments) to the chat agent with a prompt to produce a unit test that reproduces the captured state. This is useful to turn a real production event into a regression test. Fix in ChatThe Fix in Chat button appears in several contexts when the extension identifies errors or issues. Click the button to generate an AI chat prompt that summarizes the problem, includes relevant details and context, and gives specific instructions for the agent. LicenseRead the End-User License Agreement carefully before downloading or using this extension. Data and TelemetryDatadog collects certain information about your usage of this IDE, including how you interact with it, whether errors occurred while using it, what caused those errors, and user identifiers in accordance with the Datadog Privacy Policy and Datadog's VS Code extension EULA. This data is used to help improve the extension's performance and features, including transitions to and from the extension and the applicable Datadog login page for accessing the Services. If you don't wish to send this data to Datadog, you can disable this at any time in the extension's settings:
Help and FeedbackHelp us improve the extension by sharing your feedback using the feedback form, email us at team-ide-integration@datadoghq.com, or create an issue in our public repository. Check out the issues section to discover known issues. Do you use Cursor, or another fork of VS Code? Find the extension on the Open VSX Registry. |






