@@ -620,15 +620,13 @@ func (s *PermsSyncer) syncUserPerms(ctx context.Context, userID int32, noPerms b
620
620
log .Object ("fetchOpts" , log .Bool ("InvalidateCache" , fetchOpts .InvalidateCaches )),
621
621
)
622
622
623
- userLabel := strconv .Itoa (int (p .UserID ))
624
- metricsSuccessPermsSyncs .WithLabelValues ("user" , userLabel ).Inc ()
625
- metricsPermsFound .WithLabelValues ("user" , userLabel ).Set (float64 (len (p .IDs )))
623
+ metricsSuccessPermsSyncs .WithLabelValues ("user" ).Inc ()
626
624
627
625
if ! oldPerms .SyncedAt .IsZero () {
628
- metricsPermsConsecutiveSyncDelay .WithLabelValues ("user" , userLabel ).Set (p .SyncedAt .Sub (oldPerms .SyncedAt ).Seconds ())
626
+ metricsPermsConsecutiveSyncDelay .WithLabelValues ("user" ).Set (p .SyncedAt .Sub (oldPerms .SyncedAt ).Seconds ())
629
627
} else {
630
- metricsFirstPermsSyncs .WithLabelValues ("user" , userLabel ).Inc ()
631
- metricsPermsFirstSyncDelay .WithLabelValues ("user" , userLabel ).Set (p .SyncedAt .Sub (user .CreatedAt ).Seconds ())
628
+ metricsFirstPermsSyncs .WithLabelValues ("user" ).Inc ()
629
+ metricsPermsFirstSyncDelay .WithLabelValues ("user" ).Set (p .SyncedAt .Sub (user .CreatedAt ).Seconds ())
632
630
}
633
631
634
632
return providerStates , nil
@@ -812,14 +810,13 @@ func (s *PermsSyncer) syncRepoPerms(ctx context.Context, repoID api.RepoID, noPe
812
810
log .Object ("fetchOpts" , log .Bool ("invalidateCaches" , fetchOpts .InvalidateCaches )),
813
811
)
814
812
815
- metricsSuccessPermsSyncs .WithLabelValues ("repo" , string (p .RepoID )).Inc ()
816
- metricsPermsFound .WithLabelValues ("repo" , string (p .RepoID )).Set (float64 (regularCount ))
813
+ metricsSuccessPermsSyncs .WithLabelValues ("repo" ).Inc ()
817
814
818
815
if ! oldPerms .SyncedAt .IsZero () {
819
- metricsPermsConsecutiveSyncDelay .WithLabelValues ("repo" , string ( p . RepoID ) ).Set (p .SyncedAt .Sub (oldPerms .SyncedAt ).Seconds ())
816
+ metricsPermsConsecutiveSyncDelay .WithLabelValues ("repo" ).Set (p .SyncedAt .Sub (oldPerms .SyncedAt ).Seconds ())
820
817
} else {
821
- metricsFirstPermsSyncs .WithLabelValues ("repo" , string ( p . RepoID ) ).Inc ()
822
- metricsPermsFirstSyncDelay .WithLabelValues ("repo" , string ( p . RepoID ) ).Set (p .SyncedAt .Sub (repo .CreatedAt ).Seconds ())
818
+ metricsFirstPermsSyncs .WithLabelValues ("repo" ).Inc ()
819
+ metricsPermsFirstSyncDelay .WithLabelValues ("repo" ).Set (p .SyncedAt .Sub (repo .CreatedAt ).Seconds ())
823
820
}
824
821
825
822
return providerStates , nil
@@ -891,9 +888,9 @@ func (s *PermsSyncer) syncPerms(ctx context.Context, syncGroups map[requestType]
891
888
)
892
889
893
890
if request .Type == requestTypeUser {
894
- metricsFailedPermsSyncs .WithLabelValues ("user" , string ( request . ID ) ).Inc ()
891
+ metricsFailedPermsSyncs .WithLabelValues ("user" ).Inc ()
895
892
} else {
896
- metricsFailedPermsSyncs .WithLabelValues ("repo" , string ( request . ID ) ).Inc ()
893
+ metricsFailedPermsSyncs .WithLabelValues ("repo" ).Inc ()
897
894
}
898
895
} else {
899
896
logger .Debug ("succeeded in syncing permissions" ,
0 commit comments