Skip to content

Commit

Permalink
[metricbeat] Fix errors in process summary on latest Linux kernels (e…
Browse files Browse the repository at this point in the history
…lastic#6306) (elastic#7155)

On Linux 4.14 and 4.15, metricbeat logs large numbers of errors such as

```
2018/02/07 11:19:46.284926 process_summary.go:79: ERR Unknown state <73> for process with pid 4
```

All affected processes appear to be kernel threads.

`<73>` translates into `I`, which is a new status code introduced into the
`/proc/<pid>/stat` output in kernel commit
torvalds/linux@06eb618

For backwards compatibility, the old and new codes are now used to increment
the count of idle processes reported in the summary.

(cherry picked from commit f416d5b)
  • Loading branch information
adriansr authored and andrewkroh committed May 31, 2018
1 parent c775b3c commit a02f1d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ https://github.com/elastic/beats/compare/v6.1.3...v6.2.0[View commits]
- Docker and Kubernetes modules are now GA, instead of Beta. {pull}6105[6105]
- Support haproxy stats gathering using http (additionaly to tcp socket). {pull}5819[5819]
- Support to optionally 'de dot' keys in http/json metricset to prevent collisions. {pull}5957[5957]
- Fix dealing with new process status codes in Linux kernel 4.14+. {pull}6306[6306]
*Packetbeat*
Expand Down
2 changes: 2 additions & 0 deletions metricbeat/module/system/process_summary/process_summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ func (m *MetricSet) Fetch() (common.MapStr, error) {
summary.running++
case 'D':
summary.idle++
case 'I':
summary.idle++
case 'T':
summary.stopped++
case 'Z':
Expand Down

0 comments on commit a02f1d6

Please sign in to comment.