diff --git a/app/models/metric/ci_mixin/capture.rb b/app/models/metric/ci_mixin/capture.rb index 9daa6529633..2709ac78cc4 100644 --- a/app/models/metric/ci_mixin/capture.rb +++ b/app/models/metric/ci_mixin/capture.rb @@ -131,6 +131,12 @@ def perf_capture(interval_name, start_time = nil, end_time = nil) end raise ArgumentError, _("end_time cannot be specified if start_time is nil") if start_time.nil? && !end_time.nil? + # if target (== self) is archived, skip it + if respond_to?(:ems_id) && ems_id.nil? + _log.warn("C&U collection's target is archived (no EMS associated), skipping. Target: #{log_target}") + return + end + start_time, end_time = fix_capture_start_end_time(interval_name, start_time, end_time) start_range, end_range, counters_data = just_perf_capture(interval_name, start_time, end_time)