Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added function to return pretty names on "system" module "process summary" metricset #8275

Merged
merged 4 commits into from
Sep 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ https://github.com/elastic/beats/compare/v6.4.0...master[Check the HEAD diff]
- Increase ignore_above for system.process.cmdline to 2048. {pull}8101[8100]
- Add support to renamed fields planned for redis 5.0. {pull}8167[8167]
- Allow TCP helper to support delimiters and graphite module to accept multiple metrics in a single payload. {pull}8278[8278]
- Added 'died' PID state to process_system metricset on system module{pull}8275[8275]

*Packetbeat*

Expand Down
10 changes: 10 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19638,6 +19638,16 @@ type: long
Number of zombie processes on this host.


--

*`system.process.summary.dead`*::
+
--
type: long

Number of dead processes on this host. It's very unlikely that it will appear but in some special situations it may happen.


--

*`system.process.summary.unknown`*::
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/system/fields.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions metricbeat/module/system/process_summary/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
type: long
description: >
Number of zombie processes on this host.
- name: dead
type: long
description: >
Number of dead processes on this host. It's very unlikely that it will appear but in some special situations it may happen.
- name: unknown
type: long
description: >
Expand Down
6 changes: 5 additions & 1 deletion metricbeat/module/system/process_summary/process_summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func (m *MetricSet) Fetch() (common.MapStr, error) {
stopped int
zombie int
unknown int
dead int
}

for _, pid := range pids {
Expand All @@ -95,8 +96,10 @@ func (m *MetricSet) Fetch() (common.MapStr, error) {
summary.stopped++
case 'Z':
summary.zombie++
case 'X':
summary.dead++
default:
logp.Err("Unknown state <%v> for process with pid %d", state.State, pid)
logp.Err("Unknown or unexpected state <%c> for process with pid %d", state.State, pid)
summary.unknown++
}
}
Expand All @@ -109,6 +112,7 @@ func (m *MetricSet) Fetch() (common.MapStr, error) {
"stopped": summary.stopped,
"zombie": summary.zombie,
"unknown": summary.unknown,
"dead": summary.dead,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will need to add this new field to metricbeat/module/system/process_summary/_meta/fields.yml, after adding it you will also need to run make update.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in e4c9bab8e90c4151813763c544210eb2a08f491e

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add also a changelog entry regarding this new field.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in e4c9bab8e90c4151813763c544210eb2a08f491e

}
// change the name space to use . instead of _
event[mb.NamespaceKey] = "process.summary"
Expand Down