Skip to content

Commit

Permalink
put rpc counter inside trace
Browse files Browse the repository at this point in the history
  • Loading branch information
amirylm committed Jul 1, 2024
1 parent cf2e37b commit 5cfa510
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ func (c *Controller) setupPubsubRouter(ctx context.Context, cfg commons.Config)
opts = append(opts, pubsub.WithSeenMessagesTTL(cfg.Pubsub.Overlay.SeenTtl))
}

opts = append(opts, pubsub.WithAppSpecificRpcInspector(func(p peer.ID, rpc *pubsub.RPC) error {
c.pubsubRpcCounter.Add(1)
return nil
}))

denylist := pubsub.NewMapBlacklist()
opts = append(opts, pubsub.WithBlacklist(denylist))

Expand Down Expand Up @@ -74,6 +69,11 @@ func (c *Controller) setupPubsubRouter(ctx context.Context, cfg commons.Config)
tracer := newPubsubTracer(c.lggr.Named("PubsubTracer"), cfg.Pubsub.Trace.Debug, cfg.Pubsub.Trace.Skiplist, jtracer)
c.psTracer = tracer.(*psTracer)
opts = append(opts, pubsub.WithEventTracer(tracer))
// TODO: config?
opts = append(opts, pubsub.WithAppSpecificRpcInspector(func(p peer.ID, rpc *pubsub.RPC) error {
c.pubsubRpcCounter.Add(1)
return nil
}))
}

ps, err := pubsub.NewGossipSub(ctx, c.host, opts...)
Expand Down

0 comments on commit 5cfa510

Please sign in to comment.