Stop using deprecated SetMetricFamilyInjectionHook
This commit is contained in:
parent
3983cd58ff
commit
01a9a37556
1 changed files with 4 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue