diff options
author | Paul Gier <pgier@redhat.com> | 2019-05-10 13:04:26 -0500 |
---|---|---|
committer | Ben Kochie <superq@gmail.com> | 2019-05-10 13:04:26 -0500 |
commit | 8b13c130b7a7a494f5055429fded249386ec097c (patch) | |
tree | 7968db28092bf5c138a8afe14d958ba473e245cd /collector/processes_linux.go | |
parent | d0a66c4c403fc93b209b98b8cc9f4d1e2ddf2356 (diff) | |
download | prometheus_node_collector-8b13c130b7a7a494f5055429fded249386ec097c.tar.bz2 prometheus_node_collector-8b13c130b7a7a494f5055429fded249386ec097c.tar.xz prometheus_node_collector-8b13c130b7a7a494f5055429fded249386ec097c.zip |
log pid when there is a problem reading the process stats (#1341)
Signed-off-by: Paul Gier <pgier@redhat.com>
Diffstat (limited to 'collector/processes_linux.go')
-rw-r--r-- | collector/processes_linux.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/collector/processes_linux.go b/collector/processes_linux.go index 1ee012e..9b171ac 100644 --- a/collector/processes_linux.go +++ b/collector/processes_linux.go | |||
@@ -108,10 +108,11 @@ func (c *processCollector) getAllocatedThreads() (int, map[string]int32, int, er | |||
108 | stat, err := pid.NewStat() | 108 | stat, err := pid.NewStat() |
109 | // PIDs can vanish between getting the list and getting stats. | 109 | // PIDs can vanish between getting the list and getting stats. |
110 | if os.IsNotExist(err) { | 110 | if os.IsNotExist(err) { |
111 | log.Debugf("file not found when retrieving stats: %q", err) | 111 | log.Debugf("file not found when retrieving stats for pid %v: %q", pid, err) |
112 | continue | 112 | continue |
113 | } | 113 | } |
114 | if err != nil { | 114 | if err != nil { |
115 | log.Debugf("error reading stat for pid %v: %q", pid, err) | ||
115 | return 0, nil, 0, err | 116 | return 0, nil, 0, err |
116 | } | 117 | } |
117 | pids++ | 118 | pids++ |