-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,7 @@ func (m *MetricSet) Fetch() (common.MapStr, error) { | |
stopped int | ||
zombie int | ||
unknown int | ||
dead int | ||
} | ||
|
||
for _, pid := range pids { | ||
|
@@ -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++ | ||
} | ||
} | ||
|
@@ -109,6 +112,7 @@ func (m *MetricSet) Fetch() (common.MapStr, error) { | |
"stopped": summary.stopped, | ||
"zombie": summary.zombie, | ||
"unknown": summary.unknown, | ||
"dead": summary.dead, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, add also a changelog entry regarding this new field. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||
|
There was a problem hiding this comment.
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 runmake update
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in e4c9bab8e90c4151813763c544210eb2a08f491e