mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-28 06:59:44 -08:00
Stop using deprecated SetMetricFamilyInjectionHook
This commit is contained in:
parent
3983cd58ff
commit
01a9a37556
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue