---
title: "Configure IIS to expose performance counters | Grafana Labs"
description: "Verify and enable the IIS features and performance counters required for metrics collection."
---

# Configure IIS to expose performance counters

Before Grafana Alloy can collect IIS metrics, you need to verify that the required IIS features and performance counters are available on your Windows Server.

The IIS integration relies on Windows performance counters to collect request, connection, and worker process metrics. Most of these counters are available by default when IIS is installed, but some require additional IIS role services.

To verify and enable IIS performance counters, complete the following steps:

1. Open **PowerShell as Administrator** on your Windows Server.
2. Verify that IIS is installed and the required role services are enabled:
   
   powershell ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```powershell
   Get-WindowsFeature Web-Server, Web-Request-Monitor, Web-Http-Logging, Web-Stat-Compression
   ```
   
   All listed features should show `[X]` (installed). If any feature shows `[ ]`, install it in the next step.
3. If any features are missing, install them:
   
   powershell ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```powershell
   Install-WindowsFeature Web-Request-Monitor, Web-Http-Logging, Web-Stat-Compression
   ```
   
   > **Tip:** The `Web-Request-Monitor` feature enables the IIS Request Monitor module, which provides detailed per-request metrics.
4. Verify that IIS performance counter categories are available:
   
   powershell ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```powershell
   [System.Diagnostics.PerformanceCounterCategory]::Exists('Web Service')
   [System.Diagnostics.PerformanceCounterCategory]::Exists('W3SVC_W3WP')
   ```
   
   Both commands should return `True`. The `Web Service` category provides site-level metrics and `W3SVC_W3WP` provides worker process metrics.
5. Verify that at least one IIS site is running:
   
   powershell ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```powershell
   Get-IISSite
   ```
   
   You should see at least one site with a status of `Started`. If no sites are running, the integration won’t have any metrics to collect.

* * *

### More to explore

- [IIS performance counters reference](https://learn.microsoft.com/en-us/iis/manage/provisioning-and-managing-iis/managing-iis-log-file-storage)
- [Windows exporter IIS collector](/docs/alloy/latest/reference/components/prometheus/prometheus.exporter.windows/)
