Skip to content

Commit

Permalink
log pid when there is a problem reading the process stats (#1341)
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Gier <pgier@redhat.com>
  • Loading branch information
pgier authored and SuperQ committed May 10, 2019
1 parent d0a66c4 commit 8b13c13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion collector/processes_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ func (c *processCollector) getAllocatedThreads() (int, map[string]int32, int, er
stat, err := pid.NewStat()
// PIDs can vanish between getting the list and getting stats.
if os.IsNotExist(err) {
log.Debugf("file not found when retrieving stats: %q", err)
log.Debugf("file not found when retrieving stats for pid %v: %q", pid, err)
continue
}
if err != nil {
log.Debugf("error reading stat for pid %v: %q", pid, err)
return 0, nil, 0, err
}
pids++
Expand Down

0 comments on commit 8b13c13

Please sign in to comment.