diff --git a/metricbeat/module/system/process/process.go b/metricbeat/module/system/process/process.go index cebe224916e..684c87059c9 100644 --- a/metricbeat/module/system/process/process.go +++ b/metricbeat/module/system/process/process.go @@ -113,6 +113,7 @@ func (m *MetricSet) Fetch(r mb.ReporterV2) error { if m.setpid == 0 { procs, roots, err := m.stats.Get() if err != nil && !errors.Is(err, process.NonFatalErr{}) { + // return only if the error is fatal in nature return fmt.Errorf("process stats: %w", err) } diff --git a/metricbeat/module/system/process_summary/process_summary.go b/metricbeat/module/system/process_summary/process_summary.go index 9bf78f0bf45..cbf1c63a2fe 100644 --- a/metricbeat/module/system/process_summary/process_summary.go +++ b/metricbeat/module/system/process_summary/process_summary.go @@ -71,6 +71,7 @@ func (m *MetricSet) Fetch(r mb.ReporterV2) error { procList, degradeErr := process.ListStates(m.sys) if degradeErr != nil && !errors.Is(degradeErr, process.NonFatalErr{}) { + // return only if the error is fatal in nature return fmt.Errorf("error fetching process list: %w", degradeErr) }