Skip to content

Commit 18d38af

Browse files
committed
fix: add comments
1 parent 806cda4 commit 18d38af

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

metricbeat/module/system/process/process.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ func (m *MetricSet) Fetch(r mb.ReporterV2) error {
113113
if m.setpid == 0 {
114114
procs, roots, err := m.stats.Get()
115115
if err != nil && !errors.Is(err, process.NonFatalErr{}) {
116+
// return only if the error is fatal in nature
116117
return fmt.Errorf("process stats: %w", err)
117118
}
118119

metricbeat/module/system/process_summary/process_summary.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ func (m *MetricSet) Fetch(r mb.ReporterV2) error {
7171

7272
procList, degradeErr := process.ListStates(m.sys)
7373
if degradeErr != nil && !errors.Is(degradeErr, process.NonFatalErr{}) {
74+
// return only if the error is fatal in nature
7475
return fmt.Errorf("error fetching process list: %w", degradeErr)
7576
}
7677

0 commit comments

Comments
 (0)