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

Service checks at two levels of granularity and the values that complement them (as of October 2026)
GranularityService checkCondition for CRITICALValues to view alongside
Siteiis.site_upThe site's uptime is 0iis.uptime and per-site request counts
Application pooliis.app_pool_upA tagged pool is stoppediis.app_pool.state / iis.app_pool.uptime / iis.app_pool.recycle.count
Source: IIS

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.

Main settings that decide what to monitor (as of October 2026)
SettingWhen omittedWhen written
sitesReads all sites and tags them by site nameReads only the listed sites
app_poolsReads all pools and tags them by pool nameReads only the listed pools
serverThe machine the Agent runs onConnects to another server (add username and password)
Source: iis conf.yaml.example

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

Values of iis.app_pool.state (as of October 2026)
ValueState
1Uninitialized
2Initialized
3Running
4Disabling
5Disabled
6Shutdown Pending
7Delete Pending
Source: IIS

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
Items in the logs section (as of October 2026)
ItemMeaningWhether to change it from the example
typeThe type of reading; file for filesLeave as is
pathThe log file to readMatch the location on your server
serviceThe name of the service that produced the logsMatch your service name
sourceA required attribute indicating which integration the logs belong toKeep iis
Source: IIS / iis conf.yaml.example

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
Source: Based on IIS

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

Main metrics for site volume (as of October 2026)
What you want to seeMetricUnit
Request count by typeiis.httpd_request_method.get / .post and othersRequests per second
Requests not foundiis.errors.not_foundErrors per second (mostly HTTP 404)
Locked requestsiis.errors.lockedErrors per second (mostly HTTP 423)
Current connectionsiis.net.num_connectionsNumber of connections
Amount of data transferrediis.net.bytes_sent / iis.net.bytes_rcvdBytes per second
Source: IIS

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_up goes CRITICAL for that pool only
  • Check that iis.site_up stays 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.uptime increasing from 0
Source: Based on IIS

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.

References

Share