Skip to content

Commit

Permalink
rcmgr: use default libp2p rcmgr metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann authored and Jorropo committed Jul 31, 2023
1 parent 9013cf9 commit cd25750
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 257 deletions.
13 changes: 7 additions & 6 deletions core/node/libp2p/rcmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
"os"
"path/filepath"

"github.com/ipfs/kubo/config"
"github.com/ipfs/kubo/core/node/helpers"
"github.com/ipfs/kubo/repo"

"github.com/benbjohnson/clock"
logging "github.com/ipfs/go-log/v2"
"github.com/libp2p/go-libp2p"
Expand All @@ -15,11 +19,8 @@ import (
"github.com/libp2p/go-libp2p/core/protocol"
rcmgr "github.com/libp2p/go-libp2p/p2p/host/resource-manager"
"github.com/multiformats/go-multiaddr"
"github.com/prometheus/client_golang/prometheus"
"go.uber.org/fx"

"github.com/ipfs/kubo/config"
"github.com/ipfs/kubo/core/node/helpers"
"github.com/ipfs/kubo/repo"
)

var rcmgrLogger = logging.Logger("rcmgr")
Expand Down Expand Up @@ -73,8 +74,8 @@ filled in with autocomputed defaults.`)
if err != nil {
return nil, opts, err
}

ropts := []rcmgr.Option{rcmgr.WithMetrics(createRcmgrMetrics()), rcmgr.WithTraceReporter(str)}
rcmgrObs.MustRegisterWith(prometheus.DefaultRegisterer)

Check failure on line 77 in core/node/libp2p/rcmgr.go

View workflow job for this annotation

GitHub Actions / go-test

undefined: rcmgrObs

Check failure on line 77 in core/node/libp2p/rcmgr.go

View workflow job for this annotation

GitHub Actions / go-build

undefined: rcmgrObs

Check failure on line 77 in core/node/libp2p/rcmgr.go

View workflow job for this annotation

GitHub Actions / interop-prep

undefined: rcmgrObs

Check failure on line 77 in core/node/libp2p/rcmgr.go

View workflow job for this annotation

GitHub Actions / go-check

undefined: rcmgrObs

Check failure on line 77 in core/node/libp2p/rcmgr.go

View workflow job for this annotation

GitHub Actions / go-check

undefined: rcmgrObs

Check failure on line 77 in core/node/libp2p/rcmgr.go

View workflow job for this annotation

GitHub Actions / docker-build

undefined: rcmgrObs

Check failure on line 77 in core/node/libp2p/rcmgr.go

View workflow job for this annotation

GitHub Actions / go-lint

undefined: rcmgrObs) (typecheck)

Check failure on line 77 in core/node/libp2p/rcmgr.go

View workflow job for this annotation

GitHub Actions / go-lint

undefined: rcmgrObs) (typecheck)

Check failure on line 77 in core/node/libp2p/rcmgr.go

View workflow job for this annotation

GitHub Actions / go-lint

undefined: rcmgrObs) (typecheck)
ropts := []rcmgr.Option{rcmgr.WithTraceReporter(str)}

if len(cfg.ResourceMgr.Allowlist) > 0 {
var mas []multiaddr.Multiaddr
Expand Down
251 changes: 0 additions & 251 deletions core/node/libp2p/rcmgr_metrics.go

This file was deleted.

0 comments on commit cd25750

Please sign in to comment.