Monitoring IIS with Datadog - Sites and Application Pools
The IIS integration ships with the Agent: write iis.d/conf.yaml and restart the Agent, and per-site values and two service checks arrive. Being able to tell whether a site or an application pool stopped is what pays off when monitoring Windows servers.
Did the Site Stop, or the Application Pool?
The first thing you want to know from an IIS failure notification is which unit stopped. In IIS, the site, the entry point visible from outside, and the application pool that runs the application behind it are separate units. The Datadog IIS integration has a service check for each of these two units (as of October 2026; source: IIS).
| Granularity | Service check | Condition for CRITICAL | Values to view alongside |
|---|---|---|---|
| Site | iis.site_up | The site's uptime is 0 | iis.uptime and per-site request counts |
| Application pool | iis.app_pool_up | A tagged pool is stopped | iis.app_pool.state / iis.app_pool.uptime / iis.app_pool.recycle.count |
Site uptime is read from the Windows performance counter Web Service(*)\Service Uptime. If the site side is CRITICAL, the entry point's uptime has been broken; if only the pool side is CRITICAL, the site's uptime is intact while the pool behind it has stopped. You can read the two apart this way. The more sites and pools share a single server, the more this separation pays off. If you watch only one level of granularity, you are left with the work of logging in to the server after receiving the failure notification and searching by eye for which one stopped.
Narrow What You Monitor With sites and app_pools in iis.d/conf.yaml
There is no separate package to install for the integration; the IIS check ships with the Agent. Install the Agent on the IIS server, write iis.d/conf.yaml under the Agent's conf.d, and restart the Agent, and values start arriving. The minimum is Agent 6.0.0 (as of October 2026; source: IIS). How to install the Agent on Windows and how to handle the account it runs as are summarized in installing the Agent on Windows.
| Setting | When omitted | When written |
|---|---|---|
sites | Reads all sites and tags them by site name | Reads only the listed sites |
app_pools | Reads all pools and tags them by pool name | Reads only the listed pools |
server | The machine the Agent runs on | Connects to another server (add username and password) |
With Agent 7.34 and later, you can write sites and app_pools not as a list of names but as a pair of regular expression include and exclude entries.
instances:
- sites:
include:
- ^shop-
exclude:
- ^test-
app_pools:
include:
- ^shop-In an organization with naming conventions, this form saves you from editing the conf every time you add a site. Conversely, if you write nothing, everything is in scope, so one approach is to write nothing at first and read everything, then drop unneeded sites with exclude once you see them; this makes oversights less likely. When you finish, check whether iis appears in the Checks section of the Agent's status output.
Pool State Arrives as a Number From 1 to 7
The service check iis.app_pool_up is a binary of stopped or running, but the metric iis.app_pool.state returns the pool's state as a number on a 7-step scale. States that the binary cannot show, such as in the middle of stopping or while waiting to be deleted, appear in this number (as of October 2026; source: IIS).
| Value | State |
|---|---|
| 1 | Uninitialized |
| 2 | Initialized |
| 3 | Running |
| 4 | Disabling |
| 5 | Disabled |
| 6 | Shutdown Pending |
| 7 | Delete Pending |
The numbers are categories whose magnitude has no meaning, so taking an average makes them unreadable. If you graph them, split by pool and look at the last value, or look for a match with a specific value, as in "when it becomes anything other than 3." What you also want to watch is iis.app_pool.recycle.count, which counts how many times the pool has been recycled since Windows Process Activation Service (WAS) started. iis.app_pool.uptime is the number of seconds since the pool started. Even while the service check stays OK, on a day when the recycle count suddenly rises, or when uptime repeatedly drops back near 0, the pool is being rebuilt behind the scenes. The division of labor is that the service check tells you it stopped, and these two values tell you how much it was fluctuating.
The Agent Follows the IIS Log Files and Sends Them
Once metrics and service checks have told you where it stopped, you trace what was happening in the access logs. Log collection in the Agent is disabled by default, so first write logs_enabled: true in datadog.yaml. Then add a logs section to iis.d/conf.yaml and restart the Agent (as of October 2026; source: IIS).
logs:
- type: file
path: C:\inetpub\logs\LogFiles\W3SVC1\u_ex*
service: myservice
source: iis| Item | Meaning | Whether to change it from the example |
|---|---|---|
type | The type of reading; file for files | Leave as is |
path | The log file to read | Match the location on your server |
service | The name of the service that produced the logs | Match your service name |
source | A required attribute indicating which integration the logs belong to | Keep iis |
The default log location on the IIS side is %SystemDrive%\inetpub\logs\LogFiles. By default, a new log file is created every day (source: Default Log File Settings for Web Sites). Picking up files whose names change daily with the u_ex* wildcard is what the example's syntax means. If you have changed the log location in the IIS configuration, match that location. Build the parsing rules for logs after they arrive in a log pipeline; the overall picture of log collection with the Agent is in setting up log collection.
Log Folders for New Sites Do Not Have Read Permission
What is easy to miss with IIS logs is what happens after you add a site. According to the official documentation, the user the Agent runs as needs read and execute permissions on the log files you want to read. The documentation also notes that when IIS creates subfolders, such as for a new site, the parent folder's permissions are not inherited automatically (as of October 2026; source: IIS). In other words, the logs of the first site may be arriving while only the logs of sites added later silently fail to arrive.
- Add a new site to IIS
- IIS creates a subfolder for that site in the log location
- The parent folder's permissions are not inherited by the new folder
- Add the new folder to path in conf.yaml and give the Agent's user read and execute permissions
- Restart the Agent and check whether the new site's logs arrive
On the metrics side, if you do not write sites, new sites come into scope automatically, so you end up with a mismatch where metrics arrive but logs alone are missing. I recommend adding a single line, "log folder permissions and the conf path," to the runbook for adding a site. The default user for the Windows Agent is ddagentuser, and when permissions are insufficient, messages such as Access is denied. appear in the Agent's status. As a fix, the documentation shows steps for using icacls to give ddagentuser read and execute permissions on the folder (source: Log Collection Troubleshooting Guide).
Watch Per-Site Volume by Request Type and Error Count
When both the site and the pool are running but responses are slow or errors come back, you look at the per-site volume metrics. Even with a configuration that does not write sites, values carry a site name tag, so you can graph them split by site (as of October 2026; source: iis conf.yaml.example).
| What you want to see | Metric | Unit |
|---|---|---|
| Request count by type | iis.httpd_request_method.get / .post and others | Requests per second |
| Requests not found | iis.errors.not_found | Errors per second (mostly HTTP 404) |
| Locked requests | iis.errors.locked | Errors per second (mostly HTTP 423) |
| Current connections | iis.net.num_connections | Number of connections |
| Amount of data transferred | iis.net.bytes_sent / iis.net.bytes_rcvd | Bytes per second |
The errors the IIS check counts are of two kinds, requests not found and locked requests; the number of 5xx responses returned by the application is not on this list. Count 5xx responses from the status field of the access logs, or trace them through the application's traces. The steps for adding tracing to .NET applications running on IIS, and the IIS-specific restart caveats, are summarized in setting up APM for .NET.
Stop a Test Pool and Check That Only iis.app_pool_up Goes CRITICAL
Once configuration is done, before putting it into production, try stopping one application pool on a test server. Before stopping it, create a monitor that watches the iis.app_pool_up service check and notifies per pool name tag. The concept of service checks is in the Service Check glossary entry, and the types of monitors are in the Monitors explanation.
- Stop the test pool and check that
iis.app_pool_upgoes CRITICAL for that pool only - Check that
iis.site_upstays OK at the same time, confirming that the two levels of granularity appear separately - Check that the monitor notification arrives with the name of the stopped pool
- Start the pool again and watch for the recovery notification and for
iis.app_pool.uptimeincreasing from 0
Through this sequence, you get to see once, from the notification side, the situation where only the pool stops while the site keeps running. Because you can read in advance the same wording as the notification that arrives during a failure, the person on call does not have to wonder which level of granularity the notification is about. When you are done, count whether the number of pools running on your server matches the number of pool name tags arriving in Datadog.