mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-05 18:16:35 +00:00
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:
@@ -1808,6 +1808,8 @@ func NewMSSQLCollector() (Collector, error) {
|
|||||||
type mssqlCollectorFunc func(ctx *ScrapeContext, ch chan<- prometheus.Metric, sqlInstance string) (*prometheus.Desc, 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) {
|
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()
|
defer wg.Done()
|
||||||
|
|
||||||
begin := time.Now()
|
begin := time.Now()
|
||||||
|
|||||||
Reference in New Issue
Block a user