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 committed Jun 14, 2023
1 parent c93e267 commit 3ba1080
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 @@ -16,11 +20,8 @@ import (
rcmgr "github.com/libp2p/go-libp2p/p2p/host/resource-manager"
rcmgrObs "github.com/libp2p/go-libp2p/p2p/host/resource-manager/obs"
"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 @@ -74,8 +75,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)
ropts := []rcmgr.Option{rcmgr.WithTraceReporter(str)}

Check warning on line 79 in core/node/libp2p/rcmgr.go

View check run for this annotation

Codecov / codecov/patch

core/node/libp2p/rcmgr.go#L78-L79

Added lines #L78 - L79 were not covered by tests

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 3ba1080

Please sign in to comment.