Skip to content

Commit

Permalink
Switch to Prometheus' collectors package
Browse files Browse the repository at this point in the history
Address a report by staticcheck: prometheus.[…] is deprecated: Use
collectors.[…] instead. (SA1019)
  • Loading branch information
hansmi committed Dec 25, 2022
1 parent 66c6724 commit 26d7053
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/kballard/go-shellquote"
"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"
Expand Down Expand Up @@ -44,9 +45,9 @@ func main() {

if !*disableExporterMetrics {
registry.MustRegister(
prometheus.NewBuildInfoCollector(),
prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}),
prometheus.NewGoCollector(),
collectors.NewBuildInfoCollector(),
collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}),
collectors.NewGoCollector(),
version.NewCollector("lvm_exporter"),
)
}
Expand Down

0 comments on commit 26d7053

Please sign in to comment.