-
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
Add system uptime metricset #4887
Conversation
06caa22
to
4ddf98c
Compare
This adds a new metricset that reports the system uptime. The metricset is enabled by default with a period of 15m. The metricset reports one field `system.uptime.duration.ms` that is the system's uptime reported in milliseconds. In Kibana the field is formatted as a `duration` and shown in human-readable format (e.g. "8 days"). Closes elastic#4848
4ddf98c
to
5e514dc
Compare
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.
LGTM, left a minor comment
metricbeat/modules.d/system.yml
Outdated
|
||
- module: system | ||
period: 15m | ||
metricsets: [uptime] |
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.
I'm wondering if this format (instead of a list with -
) may confuse some users, as we don't follow the same pattern in the whole file. WDYT?
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.
I agree. Changed to block style.
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.
Nice 👍
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.
Nice addition about the input_format
.
@@ -79,6 +79,11 @@ def field_to_json(fields, desc, path, output, | |||
if "format" in desc: | |||
fieldFormat["id"] = desc["format"] | |||
|
|||
if "input_format" in desc: |
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.
Nice
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.
Great idea!
CHANGELOG.asciidoc
Outdated
@@ -83,6 +83,8 @@ https://github.com/elastic/beats/compare/v6.0.0-beta1...master[Check the HEAD di | |||
- Add http server metricset to support push metrics via http. {pull}4770[4770] | |||
- Make config object public for graphite and http server {pull}4820[4820] | |||
|
|||
- Add system uptime metricset. {issue}[4848[4848] |
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.
Empty line above on purpose?
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.
Fixed
@@ -0,0 +1,28 @@ | |||
// +build darwin linux openbsd windows |
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.
@andrewkroh was there any reason to exclude freebsd here? sigar has the implementation for this. // cc @kaiyan-sheng @ruflin
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.
I can’t think of any reason. It probably should be tagged as freebsd,cgo
.
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.
Hi, what is the difference between freebsd
& freebsd,cgo
tags?
This adds a new metricset that reports the system uptime. The metricset
is enabled by default with a period of 15m.
The metricset reports one field
system.uptime.duration.ms
that is the system'suptime reported in milliseconds. In Kibana the field is formatted as a
duration
and shown in human-readable format (e.g. "8 days").
Closes #4848