Skip to content

Commit

Permalink
Switch to prometheus collectors package
Browse files Browse the repository at this point in the history
The currently used functions have been deprecated.
  • Loading branch information
Furisto authored and roboquat committed Jan 24, 2022
1 parent 3b653a7 commit c7ef974
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
8 changes: 5 additions & 3 deletions components/blobserve/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@
package cmd

import (
"github.com/gitpod-io/gitpod/blobserve/pkg/config"
"net/http"
"os"
"os/signal"
"path/filepath"
"syscall"

"github.com/gitpod-io/gitpod/blobserve/pkg/config"

"github.com/containerd/containerd/remotes"
"github.com/containerd/containerd/remotes/docker"
"github.com/docker/cli/cli/config/configfile"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/spf13/cobra"

Expand Down Expand Up @@ -82,8 +84,8 @@ var runCmd = &cobra.Command{
}
if cfg.PrometheusAddr != "" {
reg.MustRegister(
prometheus.NewGoCollector(),
prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}),
collectors.NewGoCollector(),
collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}),
)

handler := http.NewServeMux()
Expand Down
5 changes: 3 additions & 2 deletions components/content-service/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/spf13/cobra"
"google.golang.org/grpc"
Expand Down Expand Up @@ -100,8 +101,8 @@ var runCmd = &cobra.Command{

if cfg.Prometheus.Addr != "" {
reg.MustRegister(
prometheus.NewGoCollector(),
prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}),
collectors.NewGoCollector(),
collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}),
)

handler := http.NewServeMux()
Expand Down
5 changes: 3 additions & 2 deletions components/openvsx-proxy/pkg/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/gitpod-io/gitpod/common-go/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/prometheus/client_golang/prometheus/promhttp"
)

Expand All @@ -33,8 +34,8 @@ func (p *Prometheus) Start(cfg *Config) {

if cfg.PrometheusAddr != "" {
p.reg.MustRegister(
prometheus.NewGoCollector(),
prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}),
collectors.NewGoCollector(),
collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}),
)

handler := http.NewServeMux()
Expand Down
5 changes: 3 additions & 2 deletions components/ws-daemon/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/spf13/cobra"
"google.golang.org/grpc"
Expand Down Expand Up @@ -73,8 +74,8 @@ var runCmd = &cobra.Command{

if cfg.Prometheus.Addr != "" {
reg.MustRegister(
prometheus.NewGoCollector(),
prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}),
collectors.NewGoCollector(),
collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}),
)

handler := http.NewServeMux()
Expand Down

0 comments on commit c7ef974

Please sign in to comment.