Instrumenting Windows IIS Server
To try the preview for RUM Auto-Instrumentation, follow the instructions on this page to set up the SDK injector.
Overview
RUM Auto-Instrumentation works by injecting the RUM Browser SDK into the HTML responses being served through a web server or proxy.
Limitations
Keep in mind the following limitations when using this setup:
- This instrumentation method does not support advanced RUM configurations, except for
allowedTracingUrls
and excludedActivityUrls
. - If your web server is acting as a proxy and the upstream server uses end-to-end encryption (TLS) or content compression (gzip, zstd, Brotli), the RUM Browser SDK may not be injected. To ensure proper instrumentation:
- Disable content compression on the upstream server.
- Enable TLS origination on the web server.
Prerequisites
The Datadog Agent is installed and configured.
Set up your RUM application
Auto-Instrumentation leverages a Windows module that injects the RUM SDK into the response body for responses served by the IIS instance.
- In Datadog, navigate to the Digital Experience > Add an Application Page and select the JavaScript (JS) application type.
- Select Auto-Instrumentation and Windows IIS.
- Set up the IIS module using either the GUI installer or command line as described below:
- Download the Datadog RUM installer.
- Follow the installer as an administrator by opening the
.msi
file. - Follow the prompts and accept the license agreement.
- Set your Session and Session Replay sample rates. See guidance on configuring sampling.
- Copy and run the config command shown for each IIS site that you wish to inject RUM into.
- Run the Powershell command line as an administrator.
- Set your Session and Session Replay sample rates. See guidance on configuring sampling.
- Copy and run the config command shown for each IIS site that you wish to inject RUM into.
Updating your RUM application
You can adjust your Session Sampling and Session Replay Sampling rates from the Application Management page.
To update your RUM Application:
- Go to your RUM application from the Application Management list.
- On the Instrument Your Application page, adjust the slider or enter a specific percentage in the input box for Session Sampling or Session Replay Sampling.
- Copy and replace the code in the Datadog RUM config file for the IIS site that you instrumented.
Troubleshooting
RUM is not injected
If you notice that RUM is not being injected into HTML pages, consider the following potential causes:
- Content-Type mismatch: RUM is injected only into HTML pages. If the
Content-Type
header does not correctly indicate text/html
, the injection is skipped. - Upstream server has end-to-end encryption or content compression: See Limitations.