mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-31 16:37:31 -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.
|
// the flag is not passed.
|
||||||
log.Infof("No directory specified, see --collector.textfile.directory")
|
log.Infof("No directory specified, see --collector.textfile.directory")
|
||||||
} else {
|
} else {
|
||||||
prometheus.SetMetricFamilyInjectionHook(c.parseTextFiles)
|
prometheus.DefaultGatherer = prometheus.Gatherers{
|
||||||
|
prometheus.DefaultGatherer,
|
||||||
|
prometheus.GathererFunc(func() ([]*dto.MetricFamily, error) { return c.parseTextFiles(), nil }),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return c, nil
|
return c, nil
|
||||||
|
|
Loading…
Reference in a new issue