File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed
components/ws-manager/pkg/manager Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -786,22 +786,28 @@ func (m *Monitor) initializeWorkspaceContent(ctx context.Context, pod *corev1.Po
786
786
hist .Observe (time .Since (t ).Seconds ())
787
787
}
788
788
789
+ _ , isBackup := initializer .Spec .(* csapi.WorkspaceInitializer_Backup )
790
+
789
791
if err != nil {
790
- c , cErr := m .manager .metrics .totalRestoreFailureCounterVec .GetMetricWithLabelValues (wsType , wsClass )
791
- if cErr != nil {
792
- log .WithError (cErr ).WithField ("type" , wsType ).Warn ("cannot get counter for workspace restore failure counter" )
793
- } else {
794
- c .Inc ()
792
+ if isBackup {
793
+ c , cErr := m .manager .metrics .totalRestoreFailureCounterVec .GetMetricWithLabelValues (wsType , wsClass )
794
+ if cErr != nil {
795
+ log .WithError (cErr ).WithField ("type" , wsType ).Warn ("cannot get counter for workspace restore failure counter" )
796
+ } else {
797
+ c .Inc ()
798
+ }
795
799
}
796
800
797
801
return xerrors .Errorf ("cannot initialize workspace: %w" , err )
798
802
}
799
803
800
- c , cErr := m .manager .metrics .totalRestoreSuccessCounterVec .GetMetricWithLabelValues (wsType , wsClass )
801
- if cErr != nil {
802
- log .WithError (cErr ).WithField ("type" , wsType ).Warn ("cannot get counter for workspace restore success counter" )
803
- } else {
804
- c .Inc ()
804
+ if isBackup {
805
+ c , cErr := m .manager .metrics .totalRestoreSuccessCounterVec .GetMetricWithLabelValues (wsType , wsClass )
806
+ if cErr != nil {
807
+ log .WithError (cErr ).WithField ("type" , wsType ).Warn ("cannot get counter for workspace restore success counter" )
808
+ } else {
809
+ c .Inc ()
810
+ }
805
811
}
806
812
return nil
807
813
}
You can’t perform that action at this time.
0 commit comments