Skip to content

Commit

Permalink
Merge pull request #214 from sacloud/fix/deprecated
Browse files Browse the repository at this point in the history
deprecated funcの対応
  • Loading branch information
hekki authored Dec 20, 2024
2 parents 023c7bf + 979b080 commit ffa31a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"time"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/sacloud/sakuracloud_exporter/collector"
"github.com/sacloud/sakuracloud_exporter/config"
Expand Down Expand Up @@ -82,14 +83,14 @@ func main() {
}, []string{"collector"})

r := prometheus.NewRegistry()
r.MustRegister(prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{
r.MustRegister(collectors.NewProcessCollector(collectors.ProcessCollectorOpts{
PidFn: func() (int, error) { return os.Getpid(), nil },
}))

ctx, cancel := context.WithCancel(ctx)

// collector info
r.MustRegister(prometheus.NewGoCollector())
r.MustRegister(collectors.NewGoCollector())
r.MustRegister(collector.NewExporterCollector(ctx, logger, Version, Revision, GoVersion, StartTime))
r.MustRegister(errs)

Expand Down

0 comments on commit ffa31a3

Please sign in to comment.