Skip to content

Commit

Permalink
disable metrics when generating the host
Browse files Browse the repository at this point in the history
Signed-off-by: mudler <mudler@localai.io>
  • Loading branch information
mudler committed Oct 30, 2023
1 parent 7e16042 commit 3cdf2c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}))
Expand Down
2 changes: 2 additions & 0 deletions pkg/node/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3cdf2c6

Please sign in to comment.