---
title: Single Step APM Instrumentation on Windows
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > APM > Application Instrumentation > Single Step APM Instrumentation >
  Single Step APM Instrumentation on Windows
---

# Single Step APM Instrumentation on Windows

## Overview{% #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.

## Enable APM on Windows{% #enable-apm-on-windows %}

{% alert level="info" %}
Before proceeding, confirm that your environment is compatible by reviewing the [SSI compatibility guide.](https://docs.datadoghq.com/tracing/trace_collection/automatic_instrumentation/single-step-apm/compatibility.md)
{% /alert %}

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

{% tab title="IIS" %}
To instrument only .NET applications running on IIS:

1. In Datadog, go to [Install the Datadog Agent on Windows](https://app.datadoghq.com/fleet/install-agent/latest?platform=windows).

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

1. (Optional) Set your SDK version:

By default, Single Step Instrumentation installs the latest supported version of the Datadog .NET SDK. If you need to pin a specific version:

   1. Under **Instrumentation Configuration**, select **Customize Library Versions**.
   1. Under .NET, choose the version you want to use.

1. Copy and run the provided MSI install command on your Windows host.

1. Restart the IIS applications you want instrumented. (You do not need to restart the entire IIS server.)

After installation, the Agent automatically loads the Datadog .NET SDK into supported application processes to enable distributed tracing.
{% /tab %}

{% tab title="Host-wide (Preview)" %}

{% alert level="info" %}
**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.
{% /alert %}

To instrument Java and .NET applications across your entire Windows host:

1. In Datadog, go to [Install the Datadog Agent on Windows](https://app.datadoghq.com/fleet/install-agent/latest?platform=windows).

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

1. (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**.
   1. Under .NET, choose the version you want to use.

1. Copy and run the provided MSI install command on your Windows host.

1. Restart the services you want instrumented.

{% /tab %}

{% alert level="info" %}
SSI adds a small amount of startup time to instrumented applications. If this overhead is not acceptable for your use case, contact [Datadog Support](https://docs.datadoghq.com/help/).
{% /alert %}

## Configure Unified Service Tags{% #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](https://docs.datadoghq.com/integrations/windows-service.md#tags).

## Enable SDK-dependent products and features{% #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:

| Product                                                                                                             | Environment variable                 |
| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| [Runtime Metrics](https://docs.datadoghq.com/tracing/metrics/runtime_metrics.md)                                    | `DD_RUNTIME_METRICS_ENABLED`         |
| [Log Injection](https://docs.datadoghq.com/tracing/other_telemetry/connect_logs_and_traces.md)                      | `DD_LOGS_INJECTION`                  |
| [Continuous Profiler](https://docs.datadoghq.com/profiler.md)                                                       | `DD_PROFILING_ENABLED`               |
| [Data Streams Monitoring](https://docs.datadoghq.com/data_streams.md)                                               | `DD_DATA_STREAMS_ENABLED`            |
| [App and API Protection](https://docs.datadoghq.com/security/application_security.md)                               | `DD_APPSEC_ENABLED`                  |
| [Runtime Code Analysis (IAST)](https://docs.datadoghq.com/security/code_security/iast.md)                           | `DD_IAST_ENABLED`                    |
| [Dynamic Instrumentation](https://docs.datadoghq.com/tracing/trace_collection/dynamic_instrumentation.md)           | `DD_DYNAMIC_INSTRUMENTATION_ENABLED` |
| [Data Jobs Monitoring](https://docs.datadoghq.com/data_jobs.md)                                                     | `DD_DATA_JOBS_ENABLED`               |
| [Software Composition Analysis](https://docs.datadoghq.com/security/code_security/software_composition_analysis.md) | `DD_APPSEC_SCA_ENABLED`              |

To enable products, [set environment variables](https://docs.datadoghq.com/tracing/trace_collection/library_config.md) in your application configuration.

## Advanced options{% #advanced-options %}

### Define instrumentation rules{% #define-instrumentation-rules %}

{% alert level="info" %}
Instrumentation rules (available for Agent v7.73+) apply only to host-wide instrumentation. They are not supported for IIS-only installation.
{% /alert %}

Instrumentation rules let you control which processes are automatically instrumented by SSI on Windows hosts.

To configure instrumentation rules:

1. In Datadog, go to **APM** > **Service Setup** > [**Manage Instrumentation Rules**](https://app.datadoghq.com/apm/service-setup/workload-selection).

1. Click **Add or Edit Rules**.

1. Define instrumentation rules:

   1. Click **Add New Rule**, then choose **Allow Rule** or **Block Rule** to specify whether matching processes should be instrumented.
   1. Name your rule.
   1. Add one or more conditions. See Define rule conditions to learn more.

   {% image
      source="https://docs.dd-static.net/images/tracing/trace_collection/define_instrumentation_rule.3676784434032a84eb248a75a996342a.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/tracing/trace_collection/define_instrumentation_rule.3676784434032a84eb248a75a996342a.png?auto=format&fit=max&w=850&dpr=2 2x"
      alt="The instrumentation rules UI, showing configuration options for defining a rule" /%}

1. (Optional) Drag and drop rules to reorder them.

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

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

1. Click **Next** to preview your rules.

1. 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{% #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{% #example-use-cases %}

Review the following examples demonstrating how to apply instrumentation rules:

{% collapsible-section %}
##### Example 1: Instrument all processes except specific ones
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.
{% image
   source="https://docs.dd-static.net/images/tracing/trace_collection/instrumentation-rules-example-1.7ece2768c405f33dc7f2aaa819dcedab.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/tracing/trace_collection/instrumentation-rules-example-1.7ece2768c405f33dc7f2aaa819dcedab.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="Two block instrumentation rules targeting Working Directory and Entry Point File conditions, with a default of allow instrumentation" /%}

{% /collapsible-section %}

{% collapsible-section %}
##### Example 2: Instrument only specific IIS applications
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.
{% image
   source="https://docs.dd-static.net/images/tracing/trace_collection/instrumentation-rules-example-2.ec17e2da0eed654bd1c8ff14a701eeda.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/tracing/trace_collection/instrumentation-rules-example-2.ec17e2da0eed654bd1c8ff14a701eeda.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="Two allow instrumentation rules targeting specific IIS application pools by name, with a default of block instrumentation" /%}

{% /collapsible-section %}

## Remove Single Step APM instrumentation from your Agent{% #remove-single-step-apm-instrumentation-from-your-agent %}

To disable SSI for .NET on your host, run:

```shell
&"C:\Program Files\Datadog\Datadog Agent\bin\datadog-installer.exe" remove datadog-apm-library-dotnet
```

## Troubleshooting{% #troubleshooting %}

If you encounter problems enabling APM with SSI, see the [SSI troubleshooting guide](https://docs.datadoghq.com/tracing/trace_collection/automatic_instrumentation/single-step-apm/troubleshooting.md).

## Further reading{% #further-reading %}

- [Enable Runtime Metrics](https://docs.datadoghq.com/tracing/metrics/runtime_metrics.md)
