Merge pull request #937 from breed808/iis_flags

Add missing whitelist/blacklist checks for IIS
This commit is contained in:
Ben Reedy 2022-02-02 18:18:13 +10:00 committed by GitHub
commit e07b2053af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -885,6 +885,10 @@ func (c *IISCollector) collectWebService(ctx *ScrapeContext, ch chan<- prometheu
}
for _, app := range WebService {
if app.Name == "_Total" || c.siteBlacklistPattern.MatchString(app.Name) || !c.siteWhitelistPattern.MatchString(app.Name) {
continue
}
ch <- prometheus.MustNewConstMetric(
c.CurrentAnonymousUsers,
prometheus.GaugeValue,
@ -1159,6 +1163,12 @@ func (c *IISCollector) collectAPP_POOL_WAS(ctx *ScrapeContext, ch chan<- prometh
}
for _, app := range APP_POOL_WAS {
if app.Name == "_Total" ||
c.appBlacklistPattern.MatchString(app.Name) ||
!c.appWhitelistPattern.MatchString(app.Name) {
continue
}
for key, label := range applicationStates {
isCurrentState := 0.0
if key == uint32(app.CurrentApplicationPoolState) {