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:
Open PowerShell as Administrator on your Windows Server.
Verify that IIS is installed and the required role services are enabled:
Get-WindowsFeature Web-Server, Web-Request-Monitor, Web-Http-Logging, Web-Stat-CompressionAll listed features should show
[X](installed). If any feature shows[ ], install it in the next step.If any features are missing, install them:
Install-WindowsFeature Web-Request-Monitor, Web-Http-Logging, Web-Stat-CompressionTip: The
Web-Request-Monitorfeature enables the IIS Request Monitor module, which provides detailed per-request metrics.Verify that IIS performance counter categories are available:
[System.Diagnostics.PerformanceCounterCategory]::Exists('Web Service') [System.Diagnostics.PerformanceCounterCategory]::Exists('W3SVC_W3WP')Both commands should return
True. TheWeb Servicecategory provides site-level metrics andW3SVC_W3WPprovides worker process metrics.Verify that at least one IIS site is running:
Get-IISSiteYou 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.