@@ -198,7 +198,7 @@ func (s *GRPCServer) Sync(req *proto.EncryptedMessage, srv proto.ManagementServi
198
198
s .secretsManager .SetupRefresh (ctx , accountID , peer .ID )
199
199
200
200
if s .appMetrics != nil {
201
- s .appMetrics .GRPCMetrics ().CountSyncRequestDuration (time .Since (reqStart ))
201
+ s .appMetrics .GRPCMetrics ().CountSyncRequestDuration (time .Since (reqStart ), accountID )
202
202
}
203
203
204
204
unlock ()
@@ -436,11 +436,7 @@ func (s *GRPCServer) parseRequest(ctx context.Context, req *proto.EncryptedMessa
436
436
// In case of the successful registration login is also successful
437
437
func (s * GRPCServer ) Login (ctx context.Context , req * proto.EncryptedMessage ) (* proto.EncryptedMessage , error ) {
438
438
reqStart := time .Now ()
439
- defer func () {
440
- if s .appMetrics != nil {
441
- s .appMetrics .GRPCMetrics ().CountLoginRequestDuration (time .Since (reqStart ))
442
- }
443
- }()
439
+
444
440
if s .appMetrics != nil {
445
441
s .appMetrics .GRPCMetrics ().CountLoginRequest ()
446
442
}
@@ -463,6 +459,12 @@ func (s *GRPCServer) Login(ctx context.Context, req *proto.EncryptedMessage) (*p
463
459
//nolint
464
460
ctx = context .WithValue (ctx , nbContext .AccountIDKey , accountID )
465
461
462
+ defer func () {
463
+ if s .appMetrics != nil {
464
+ s .appMetrics .GRPCMetrics ().CountLoginRequestDuration (time .Since (reqStart ), accountID )
465
+ }
466
+ }()
467
+
466
468
if loginReq .GetMeta () == nil {
467
469
msg := status .Errorf (codes .FailedPrecondition ,
468
470
"peer system meta has to be provided to log in. Peer %s, remote addr %s" , peerKey .String (), realIP )
0 commit comments