Merge pull request #1015 from breed808/iis_log_noise

Skip missing IIS instances
This commit is contained in:
Ben Reedy 2022-07-23 10:31:18 +10:00 committed by GitHub
commit 739642bd6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 10 deletions

View File

@ -1340,11 +1340,7 @@ func (c *IISCollector) collectW3SVC_W3WP(ctx *ScrapeContext, ch chan<- prometheu
// Extract the apppool name from the format <PID>_<NAME> // Extract the apppool name from the format <PID>_<NAME>
pid := workerProcessNameExtractor.ReplaceAllString(app.Name, "$1") pid := workerProcessNameExtractor.ReplaceAllString(app.Name, "$1")
name := workerProcessNameExtractor.ReplaceAllString(app.Name, "$2") name := workerProcessNameExtractor.ReplaceAllString(app.Name, "$2")
if name == "" { if name == "" || name == "_Total" ||
log.Error("no instances found in W3SVC_W3WP - skipping collection")
break
}
if name == "_Total" ||
c.appBlacklistPattern.MatchString(name) || c.appBlacklistPattern.MatchString(name) ||
!c.appWhitelistPattern.MatchString(name) { !c.appWhitelistPattern.MatchString(name) {
continue continue
@ -1596,11 +1592,7 @@ func (c *IISCollector) collectW3SVC_W3WP(ctx *ScrapeContext, ch chan<- prometheu
// Extract the apppool name from the format <PID>_<NAME> // Extract the apppool name from the format <PID>_<NAME>
pid := workerProcessNameExtractor.ReplaceAllString(app.Name, "$1") pid := workerProcessNameExtractor.ReplaceAllString(app.Name, "$1")
name := workerProcessNameExtractor.ReplaceAllString(app.Name, "$2") name := workerProcessNameExtractor.ReplaceAllString(app.Name, "$2")
if name == "" { if name == "" || name == "_Total" ||
log.Error("no instances found in W3SVC_W3WP_IIS8 - skipping collection")
break
}
if name == "_Total" ||
c.appBlacklistPattern.MatchString(name) || c.appBlacklistPattern.MatchString(name) ||
!c.appWhitelistPattern.MatchString(name) { !c.appWhitelistPattern.MatchString(name) {
continue continue