For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/tracing/trace_collection/single-step-apm/windows.md. A documentation index is available at /llms.txt.

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

Before proceeding, confirm that your environment is compatible by reviewing the SSI compatibility guide.

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:

  1. 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.

  2. 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:

  1. In Datadog, go to Install the Datadog Agent on Windows.

  2. In the Customize your observability coverage section, toggle Application Performance Monitoring (APM).

  3. (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:

    1. Under Instrumentation Configuration, select Customize Library Versions.
    2. Under .NET, choose the version you want to use.
  4. Copy and run the provided installation command on your Windows host. Datadog generates this command in-app after you are enrolled in the Preview.

  5. 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.

  6. 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.

  1. In Datadog, go to APM > Instrument a Service.

  2. Under How do you want to instrument these hosts?, select Deploy on existing hosts to instrument your services remotely through the Datadog Agent.

  3. 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.

  4. 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.

  5. 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.

  6. In Review and apply APM instrumentation, check the Configuration Summary (toggle between Summary and YAML), then click Apply Instrumentation.

  7. 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

  1. 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.

  2. 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.

Configure Unified Service Tags

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:

ProductEnvironment variable
Runtime MetricsDD_RUNTIME_METRICS_ENABLED
Log InjectionDD_LOGS_INJECTION
Continuous ProfilerDD_PROFILING_ENABLED
Data Streams MonitoringDD_DATA_STREAMS_ENABLED
App and API ProtectionDD_APPSEC_ENABLED
Runtime Code Analysis (IAST)DD_IAST_ENABLED
Dynamic InstrumentationDD_DYNAMIC_INSTRUMENTATION_ENABLED
Data Jobs MonitoringDD_DATA_JOBS_ENABLED
Software Composition AnalysisDD_APPSEC_SCA_ENABLED

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:

  1. In Datadog, go to APM > Service Setup > Manage Instrumentation Rules.

  2. Click Add or Edit Rules.

  3. Define instrumentation rules:

    1. Click Add New Rule, then choose Allow Rule or Block Rule to specify whether matching processes should be instrumented.
    2. Name your rule.
    3. Add one or more conditions. See Define rule conditions to learn more.
    The instrumentation rules UI, showing configuration options for defining a rule
  4. (Optional) Drag and drop rules to reorder them.

    Note: Rules are evaluated in order. After a process matches a rule, subsequent rules are ignored.

  5. Set the default behavior (allow or block) for processes that do not match any rule.

  6. Click Next to preview your rules.

  7. 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:

AttributeDescriptionExample
Operating SystemOS of the host.windows
ExecutableExecutable name of the process.w3wp.exe
Executable Full PathFull path of the executable.C:\Windows\System32\inetsrv\w3wp.exe
ArgumentsCommand-line arguments used to start the process.--env=production
Working DirectoryWorking directory of the process.C:\inetpub\wwwroot
LanguageProgramming language detected for the process.dotnet
Entry Point FileThe specific file used to launch the application.MyService.dll, app.py
IIS Application PoolThe 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.
Two block instrumentation rules targeting Working Directory and Entry Point File conditions, with a default of allow instrumentation
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.
Two allow instrumentation rules targeting specific IIS application pools by name, with a default of block instrumentation

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: