From 3cdf2c6d0a020641e74d34ca885b576f3747438d Mon Sep 17 00:00:00 2001 From: mudler Date: Mon, 30 Oct 2023 19:21:29 +0100 Subject: [PATCH] disable metrics when generating the host Signed-off-by: mudler --- pkg/config/config.go | 2 -- pkg/node/connection.go | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index b8321cd5..7d71425f 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -288,8 +288,6 @@ func (c Config) ToOpts(l *logger.Logger) ([]node.Option, []vpn.Option, error) { llger.Infof("connmanager disabled") } - libp2pOpts = append(libp2pOpts, libp2p.DisableMetrics()) - if !c.Limit.Enable || runtime.GOOS == "darwin" { llger.Info("go-libp2p resource manager protection disabled") libp2pOpts = append(libp2pOpts, libp2p.ResourceManager(&network.NullResourceManager{})) diff --git a/pkg/node/connection.go b/pkg/node/connection.go index 47f85688..22288743 100644 --- a/pkg/node/connection.go +++ b/pkg/node/connection.go @@ -103,6 +103,8 @@ func (e *Node) genHost(ctx context.Context) (host.Host, error) { } opts = append(opts, libp2p.ConnectionGater(cg), libp2p.Identity(prvKey)) + // Do not enable metrics for now + opts = append(opts, libp2p.DisableMetrics()) addrs := []multiaddr.Multiaddr{} for _, l := range e.config.ListenAddresses {