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
    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
    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
    [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
    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


page 5 of 11