fix: iis metrics greater than IIS v7

The IIS >= 8 metrics was updated two times by application and caused a fatal error. The purpose
of this fix is to update metrics one time by application.

Signed-off-by: Aymeric Daurelle <aymeric.daurelle@cdiscount.com>
This commit is contained in:
Aymeric Daurelle
2022-01-19 17:25:23 +01:00
committed by Aymeric
parent 4891acba2d
commit 803a0a9a70

View File

@@ -1574,6 +1574,8 @@ func (c *IISCollector) collectW3SVC_W3WP(ctx *ScrapeContext, ch chan<- prometheu
pid,
)
}
if c.iis_version.major >= 8 {
var W3SVC_W3WP_IIS8 []perflibW3SVC_W3WP_IIS8
if err := unmarshalObject(ctx.perfObjects["W3SVC_W3WP"], &W3SVC_W3WP_IIS8); err != nil {
@@ -1656,7 +1658,6 @@ func (c *IISCollector) collectW3SVC_W3WP(ctx *ScrapeContext, ch chan<- prometheu
)
}
}
}
return nil, nil
}