Description
Current Behavior
Hello!
When the app-include
filter is defined in the config file, some IIS metrics disappear, e.g. windows_iis_worker_requests_total
.
Expected Behavior
Using app-include
filter does not make some of the IIS metrics completely disappear, they should be just normally filtered like others.
Steps To Reproduce
- For example, imagine IIS with 3 application pools named
AppPool 1
,AppPool 2
andAppPool 3
- Check exported metrics (by far without
app-include
configured) - they shall contain thewindows_iis_worker_requests_total
metric for all three application pools - Set
iis.app-include
in config file toAppPool 2|AppPool 3
- Restart windows_exporter
- Check metrics - they now contain no
windows_iis_worker_requests_total
at all - while we only wanted to see the metrics ofAppPool 2
andAppPool 3
Environment
- windows_exporter Version: 0.30.7
- Windows Server Version: 2019 Standard
windows_exporter logs
time=2025-07-01T12:09:31.306Z level=INFO source=main.go:150 msg="using configuration file: [REDACTED]\\windows_exporter\\FE.yml"
time=2025-07-01T12:09:31.306Z level=DEBUG source=main.go:153 msg="logging has Started"
time=2025-07-01T12:09:31.344Z level=WARN source=os.go:109 msg="The os collector holds a number of deprecated metrics and will be removed mid 2025. See https://github.com/prometheus-community/windows_exporter/pull/1596 for more information." collector=os
time=2025-07-01T12:09:31.346Z level=DEBUG source=iis.go:233 msg="Detected IIS 10.0\n" collector=iis
time=2025-07-01T12:09:31.595Z level=INFO source=main.go:265 msg="Running as [REDACTED]"
time=2025-07-01T12:09:31.595Z level=INFO source=main.go:185 msg="Enabled collectors: cpu, iis, logical_disk, memory, os, service, tcp"
time=2025-07-01T12:09:31.596Z level=INFO source=main.go:203 msg="starting windows_exporter in 292.4013ms" version=0.30.7 branch=HEAD revision=1e24d7b2c94937a0276845b17d252bb7cd15949c goversion=go1.23.4 builddate=20250517-12:18:58 maxprocs=2
time=2025-07-01T12:09:31.597Z level=INFO source=tls_config.go:347 msg="Listening on" address=[::]:9182
time=2025-07-01T12:09:31.597Z level=INFO source=tls_config.go:350 msg="TLS is disabled." http2=false address=[::]:9182
time=2025-07-01T12:09:33.859Z level=DEBUG source=collect.go:220 msg="collector service succeeded after 1.5442ms, resulting in 14 metrics"
time=2025-07-01T12:09:33.863Z level=DEBUG source=collect.go:220 msg="collector logical_disk succeeded after 6.042ms, resulting in 17 metrics"
time=2025-07-01T12:09:33.863Z level=DEBUG source=collect.go:220 msg="collector cpu succeeded after 6.042ms, resulting in 39 metrics"
time=2025-07-01T12:09:33.867Z level=DEBUG source=collect.go:220 msg="collector os succeeded after 9.3532ms, resulting in 11 metrics"
time=2025-07-01T12:09:33.868Z level=DEBUG source=collect.go:220 msg="collector tcp succeeded after 10.7381ms, resulting in 24 metrics"
time=2025-07-01T12:09:33.868Z level=DEBUG source=collect.go:220 msg="collector memory succeeded after 10.7381ms, resulting in 35 metrics"
time=2025-07-01T12:09:33.869Z level=DEBUG source=collect.go:220 msg="collector iis succeeded after 11.6649ms, resulting in 133 metrics"
time=2025-07-01T12:09:40.039Z level=DEBUG source=collect.go:220 msg="collector logical_disk succeeded after 882.8µs, resulting in 17 metrics"
time=2025-07-01T12:09:40.041Z level=DEBUG source=collect.go:220 msg="collector memory succeeded after 2.3137ms, resulting in 35 metrics"
time=2025-07-01T12:09:40.041Z level=DEBUG source=collect.go:220 msg="collector os succeeded after 2.3137ms, resulting in 11 metrics"
time=2025-07-01T12:09:40.042Z level=DEBUG source=collect.go:220 msg="collector cpu succeeded after 3.8395ms, resulting in 39 metrics"
time=2025-07-01T12:09:40.042Z level=DEBUG source=collect.go:220 msg="collector service succeeded after 3.8395ms, resulting in 14 metrics"
time=2025-07-01T12:09:40.044Z level=DEBUG source=collect.go:220 msg="collector tcp succeeded after 5.1568ms, resulting in 24 metrics"
time=2025-07-01T12:09:40.045Z level=DEBUG source=collect.go:220 msg="collector iis succeeded after 6.797ms, resulting in 133 metrics"
Anything else?
I suspect that the problem is in this code. Lines below extract PID and pool name from data.Name
expecting it to be in <PID>_<NAME>
format while the upper line validates the entire data.Name
value against the app-include
filter regexp. If the regexp contains a set of application pool names, e.g. AppPool Name 1|AppPool Name 2
, the PID_NAME value does not match it for any application, so they are all ignored.
Sorry, not a Go coder myself to provide a PR, but I hope the fix is simple.
Thank you! :)