From 0dc32bf43477b37c5051cf33cc940f07f4918c6c Mon Sep 17 00:00:00 2001 From: yangliyl Date: Fri, 29 Apr 2022 09:18:05 +0800 Subject: [PATCH] replace these deprecated functions Signed-off-by: yangliyl --- exporter.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/exporter.go b/exporter.go index 4e87b494..38d968b2 100644 --- a/exporter.go +++ b/exporter.go @@ -23,6 +23,7 @@ import ( "github.com/prometheus-community/windows_exporter/config" "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/collectors" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/common/version" "github.com/prometheus/exporter-toolkit/web" @@ -520,8 +521,8 @@ func (mh *metricsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } reg.MustRegister(wc) reg.MustRegister( - prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}), - prometheus.NewGoCollector(), + collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}), + collectors.NewGoCollector(), version.NewCollector("windows_exporter"), )