Single Step APM Instrumentation on Windows
Overview
With Single Step Instrumentation (SSI), you can enable APM for your Java and .NET applications on Windows VMs using a single Datadog Agent installation command.
Set up APM with an agent
Install the dd-apm skill in your AI coding agent for guided APM setup.
npx skills add https://github.com/datadog-labs/agent-skills --skill dd-apm --full-depth -y
Enable APM on Windows
New Agent installation
If you don’t yet have a Datadog Agent installed, follow these steps to install the Agent and enable SSI simultaneously.
You can enable APM on Windows in the following ways:
- Instrument only .NET applications on IIS
- Instrument all Java and .NET applications across your entire Windows host
To instrument only .NET applications running on IIS:
From an administrator PowerShell session on your Windows host, run one of the following commands. Replace <YOUR_DD_API_KEY> with your Datadog API key and <YOUR_DD_SITE> with your Datadog site: .
Use the PowerShell installer:
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; $env:DD_API_KEY = '<YOUR_DD_API_KEY>'; $env:DD_SITE = '<YOUR_DD_SITE>'; $env:DD_APM_INSTRUMENTATION_ENABLED = 'iis'; $env:DD_APM_INSTRUMENTATION_LIBRARIES = 'dotnet:3'; (New-Object System.Net.WebClient).DownloadFile('https://install.datadoghq.com/datadog-installer-x86_64.exe', 'C:\Windows\SystemTemp\datadog-installer-x86_64.exe'); C:\Windows\SystemTemp\datadog-installer-x86_64.exe
Alternatively, install with the MSI:
$p = Start-Process -Wait -PassThru msiexec -ArgumentList '/qn /norestart /i "https://windows-agent.datadoghq.com/datadog-agent-7-latest.amd64.msi" /log C:\Windows\SystemTemp\install-datadog.log APIKEY="<YOUR_DD_API_KEY>" SITE="<YOUR_DD_SITE>" DD_APM_INSTRUMENTATION_ENABLED="iis" DD_APM_INSTRUMENTATION_LIBRARIES="dotnet:3"'
if ($p.ExitCode -ne 0) { Write-Host "msiexec failed with exit code $($p.ExitCode) please check the logs at C:\Windows\SystemTemp\install-datadog.log" -ForegroundColor Red }
To install a different .NET version, change dotnet:3, or omit DD_APM_INSTRUMENTATION_LIBRARIES to install the latest.
Note: The Chocolatey installation method does not preserve the SSI settings and cannot be used to enable SSI.
Restart the IIS applications you want instrumented. (You do not need to restart the entire IIS server.)
The Agent then automatically loads the Datadog .NET SDK into supported application processes to enable distributed tracing.
Generate the command from Datadog: To get a command pre-filled with your API key and site, go to Install the Datadog Agent on Windows and, in the Customize your observability coverage section, toggle Application Performance Monitoring (APM). To pin the .NET SDK version, select Customize Library Versions under Instrumentation Configuration. Then copy and run the generated command.
Join the Preview!Host-wide instrumentation for Windows is in Preview and limited to Preview participants. The installation and configuration options described in this tab appear in Datadog only after you are enrolled.
Request access to join the Preview.
To instrument Java and .NET applications across your entire Windows host:
In Datadog, go to Install the Datadog Agent on Windows.
In the Customize your observability coverage section, toggle Application Performance Monitoring (APM).
(Optional) Set your SDK version:
By default, Single Step Instrumentation installs the latest supported version of the Datadog .NET and Java SDK. If you need to pin a specific version:
- Under Instrumentation Configuration, select Customize Library Versions.
- Under .NET, choose the version you want to use.
Copy and run the provided installation command on your Windows host. Datadog generates this command in-app after you are enrolled in the Preview.
Configure instrumentation rules.
Host-wide SSI automatically instruments all Java applications on the host and all .NET applications running in IIS. To instrument .NET applications running outside of IIS, you must define an instrumentation rule that allows them. You can also use instrumentation rules for granular control over which Java applications on the host or .NET applications in IIS are instrumented.
Restart the services you want instrumented.
SSI adds a small amount of startup time to instrumented applications. If this overhead is not acceptable for your use case, contact
Datadog Support.
Existing Agent installation
If you already have a Datadog Agent installed, enable SSI remotely from Datadog. You do not need to run commands on each host.
In Datadog, go to APM > Instrument a Service.
Under How do you want to instrument these hosts?, select Deploy on existing hosts to instrument your services remotely through the Datadog Agent.
Under Which hosts should we instrument?, use the scope filters (Environments, Hostname, APM enabled) to narrow down your hosts. Then select the Agents you want to instrument on the Eligible for deployment tab. Hosts that can’t be instrumented appear on the Excluded from deployment tab.
In Configure SDKs installation, click Yes to have Datadog automatically install the tracing SDKs. To pin specific SDK versions instead of the latest, expand Customize library versions.
In Configure rollout strategy, choose what percentage of Agents to deploy to at a time. Datadog shows the resulting stages and an estimated duration. Deployments automatically pause if three consecutive Agents fail or if failures reach 10% of the total. You can re-run the deployment later.
In Review and apply APM instrumentation, check the Configuration Summary (toggle between Summary and YAML), then click Apply Instrumentation.
Configure instrumentation rules.
Host-wide SSI automatically instruments all Java applications on the host and all .NET applications running in IIS. To instrument .NET applications running outside of IIS, you must define an instrumentation rule that allows them. You can also use instrumentation rules for granular control over which Java applications on the host or .NET applications in IIS are instrumented.
Verify the installation
From an administrator PowerShell session, confirm the Agent is healthy and the APM Agent is running:
& "$env:ProgramFiles\Datadog\Datadog Agent\bin\agent.exe" status
Check the APM Agent section of the output.
After your instrumented applications receive traffic, confirm your services appear on the APM Services page. If they don’t appear within a few minutes, follow the SSI troubleshooting guide.
Unified Service Tags (USTs) apply consistent tags across traces, metrics, and logs, making it easier to navigate and correlate your observability data. Learn how to set USTs for Windows services.
Enable SDK-dependent products and features
After SSI loads the Datadog SDK into your applications and enables distributed tracing, you can configure additional products that rely on the SDK:
Note: All variables accept true or false. DD_PROFILING_ENABLED also accepts auto, which profiles only eligible processes and is recommended for SSI.
To enable products, set environment variables in your application configuration.
Advanced options
Define instrumentation rules
Instrumentation rules are not supported for your selected
Datadog site (
).
Instrumentation rules (available for Agent v7.73+) apply only to host-wide instrumentation. They are not supported for IIS-only installation.
Instrumentation rules let you control which processes are automatically instrumented by SSI on Windows hosts. Rules are required to instrument .NET applications running outside of IIS. They are also useful for granular control over which Java applications on the host or .NET applications in IIS are instrumented.
Note: You can use Bits AI to create instrumentation rules with natural language. Describe which processes you want to instrument, and Bits AI generates the corresponding rule.
To configure instrumentation rules:
In Datadog, go to APM > Service Setup > Manage Instrumentation Rules.
Click Add or Edit Rules.
Define instrumentation rules:
- Click Add New Rule, then choose Allow Rule or Block Rule to specify whether matching processes should be instrumented.
- Name your rule.
- Add one or more conditions. See Define rule conditions to learn more.
(Optional) Drag and drop rules to reorder them.
Note: Rules are evaluated in order. After a process matches a rule, subsequent rules are ignored.
Set the default behavior (allow or block) for processes that do not match any rule.
Click Next to preview your rules.
Click Deploy Rules.
If Remote Configuration is enabled, rules are deployed to every host and applied on those with SSI enabled within 50 seconds. Alternatively, click Export to export the configuration file and apply it manually to your hosts.
Define rule conditions
Each rule consists of one or more conditions. A condition includes the following elements:
- Attribute: The process property that the rule evaluates.
- Operator: The comparison logic (
equals, not equals, prefix, or contains). - Value: The text or pattern to match, such as a process name or command-line flag.
Supported attributes include:
| Attribute | Description | Example |
|---|
| Operating System | OS of the host. | windows |
| Executable | Executable name of the process. | w3wp.exe |
| Executable Full Path | Full path of the executable. | C:\Windows\System32\inetsrv\w3wp.exe |
| Arguments | Command-line arguments used to start the process. | --env=production |
| Working Directory | Working directory of the process. | C:\inetpub\wwwroot |
| Language | Programming language detected for the process. | dotnet |
| Entry Point File | The specific file used to launch the application. | MyService.dll, app.py |
| IIS Application Pool | The IIS application pool hosting the worker process. Because all IIS workers share the w3wp.exe executable, this is the most reliable way to target a specific .NET app on IIS. | DefaultAppPool, MyWebApp |
Example use cases
Review the following examples demonstrating how to apply instrumentation rules:
Instrument all processes by default. Add block rules to exclude services that would add noise without value, such as analytics cron jobs and Java batch processors.
Block all instrumentation by default. Add allow rules to opt specific IIS applications into APM. Because all IIS workers share the
w3wp.exe executable, use
IIS Application Pool to identify target applications. This approach is useful for gradual rollouts.
Remove Single Step APM instrumentation from your Agent
To disable SSI for .NET on your host, run:
&"C:\Program Files\Datadog\Datadog Agent\bin\datadog-installer.exe" remove datadog-apm-library-dotnet
Troubleshooting
If you encounter problems enabling APM with SSI, see the SSI troubleshooting guide.
Further reading
Additional helpful documentation, links, and articles: