Reset mssql child failure counter on each scrape

Resolves issue where collector would always return a failure after an
inital failure, as the counter was not reset.

Signed-off-by: Ben Reedy <breed808@breed808.com>
This commit is contained in:
Ben Reedy 2020-12-09 14:47:53 +10:00
parent 769b15eb86
commit a1a986f4d0
No known key found for this signature in database
GPG Key ID: 235C15B6086C9D7E

View File

@ -1808,6 +1808,8 @@ func NewMSSQLCollector() (Collector, error) {
type mssqlCollectorFunc func(ctx *ScrapeContext, ch chan<- prometheus.Metric, sqlInstance string) (*prometheus.Desc, error)
func (c *MSSQLCollector) execute(ctx *ScrapeContext, name string, fn mssqlCollectorFunc, ch chan<- prometheus.Metric, sqlInstance string, wg *sync.WaitGroup) {
// Reset failure counter on each scrape
c.mssqlChildCollectorFailure = 0
defer wg.Done()
begin := time.Now()