Update prometheus methods

This commit is contained in:
Manuel de Brito Fontes 2018-09-22 14:54:11 -03:00
parent 9766ad8f4b
commit 55ccaf4be3
2 changed files with 22 additions and 3 deletions

View file

@ -121,7 +121,10 @@ func main() {
reg := prometheus.NewRegistry()
reg.MustRegister(prometheus.NewGoCollector())
reg.MustRegister(prometheus.NewProcessCollector(os.Getpid(), ""))
reg.MustRegister(prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{
PidFn: func() (int, error) { return os.Getpid(), nil },
ReportErrors: true,
}))
mc, err := metric.NewCollector(conf.ListenPorts.Status, reg)
if err != nil {