Stop using deprecated SetMetricFamilyInjectionHook

This commit is contained in:
Johannes 'fish' Ziemke 2017-01-06 12:21:12 +01:00
parent 3983cd58ff
commit 01a9a37556

View file

@ -56,7 +56,10 @@ func NewTextFileCollector() (Collector, error) {
// the flag is not passed.
log.Infof("No directory specified, see --collector.textfile.directory")
} else {
prometheus.SetMetricFamilyInjectionHook(c.parseTextFiles)
prometheus.DefaultGatherer = prometheus.Gatherers{
prometheus.DefaultGatherer,
prometheus.GathererFunc(func() ([]*dto.MetricFamily, error) { return c.parseTextFiles(), nil }),
}
}
return c, nil