check that metric is using

This commit is contained in:
Sergey Cherepanov committed 2023-05-04 19:35:07 +02:00
1 parent a12f3fb0dd
commit fc4bdb6000
1 file changed
+3
+3
View File
@@ -410,6 +410,9 @@ func (s *space) handleMessage(msg HandleMessage) {
ctx := peer.CtxWithPeerId(context.Background(), msg.SenderId)
ctx = logger.CtxWithFields(ctx, zap.Uint64("msgId", msg.Id), zap.String("senderId", msg.SenderId))
defer func() {
if s.metric == nil {
return
}
s.metric.RequestLog(msg.PeerCtx, "space.streamOp", msg.LogFields(
zap.Error(err),
)...)