Skip to content

Commit

Permalink
fix: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
VihasMakwana committed Jul 23, 2024
1 parent 806cda4 commit 18d38af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions metricbeat/module/system/process/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 18d38af

Please sign in to comment.