Skip to content

Commit

Permalink
[Metricbeat] Add Linux pressure metricset (elastic#27355)
Browse files Browse the repository at this point in the history
* Adds new linux pressure metricset

* Tidy up code

* Be consistent in default config

* Run integration tests

* Make update

* make update v3

* Address comments

* Format tests

* Remove unused imports from tests

* Mage format

* Update changelog

* simplify loop

* Fix fields/mapping
  • Loading branch information
b-deam authored and wiwen committed Nov 1, 2021
1 parent d71888c commit 8184087
Show file tree
Hide file tree
Showing 19 changed files with 644 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Added Airflow lightweight module {pull}26220[26220]
- Add state_job metricset to Kubernetes module{pull}26479[26479]
- Bump AWS SDK version to v0.24.0 for WebIdentity authentication flow {issue}19393[19393] {pull}27126[27126]
- Add Linux pressure metricset {pull}27355[27355]

*Packetbeat*

Expand Down
236 changes: 236 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -43509,6 +43509,242 @@ type: object

--

[float]
=== pressure

Linux pressure stall information metrics for cpu, memory, and io


*`linux.pressure.cpu.some.10.pct`*::
+
--
The average share of time in which at least some tasks were stalled on CPU over a ten second window.


type: float

format: percent

--

*`linux.pressure.cpu.some.60.pct`*::
+
--
The average share of time in which at least some tasks were stalled on CPU over a sixty second window.


type: float

format: percent

--

*`linux.pressure.cpu.some.300.pct`*::
+
--
The average share of time in which at least some tasks were stalled on CPU over a three hundred second window.


type: float

format: percent

--

*`linux.pressure.cpu.some.total.time.us`*::
+
--
The total absolute stall time (in microseconds) in which at least some tasks were stalled on CPU.


type: long

--

*`linux.pressure.memory.some.10.pct`*::
+
--
The average share of time in which at least some tasks were stalled on Memory over a ten second window.


type: float

format: percent

--

*`linux.pressure.memory.some.60.pct`*::
+
--
The average share of time in which at least some tasks were stalled on Memory over a sixty second window.


type: float

format: percent

--

*`linux.pressure.memory.some.300.pct`*::
+
--
The average share of time in which at least some tasks were stalled on Memory over a three hundred second window.


type: float

format: percent

--

*`linux.pressure.memory.some.total.time.us`*::
+
--
The total absolute stall time (in microseconds) in which at least some tasks were stalled on memory.


type: long

--

*`linux.pressure.memory.full.10.pct`*::
+
--
The average share of time in which in which all non-idle tasks were stalled on memory simultaneously over a ten second window.


type: float

format: percent

--

*`linux.pressure.memory.full.60.pct`*::
+
--
The average share of time in which in which all non-idle tasks were stalled on memory simultaneously over a sixty second window.


type: float

format: percent

--

*`linux.pressure.memory.full.300.pct`*::
+
--
The average share of time in which in which all non-idle tasks were stalled on memory simultaneously over a three hundred second window.


type: float

format: percent

--

*`linux.pressure.memory.full.total.time.us`*::
+
--
The total absolute stall time (in microseconds) in which in which all non-idle tasks were stalled on memory.


type: long

--

*`linux.pressure.io.some.10.pct`*::
+
--
The average share of time in which at least some tasks were stalled on io over a ten second window.


type: float

format: percent

--

*`linux.pressure.io.some.60.pct`*::
+
--
The average share of time in which at least some tasks were stalled on io over a sixty second window.


type: float

format: percent

--

*`linux.pressure.io.some.300.pct`*::
+
--
The average share of time in which at least some tasks were stalled on io over a three hundred second window.


type: float

format: percent

--

*`linux.pressure.io.some.total.time.us`*::
+
--
The total absolute stall time (in microseconds) in which at least some tasks were stalled on io.


type: long

--

*`linux.pressure.io.full.10.pct`*::
+
--
The average share of time in which in which all non-idle tasks were stalled on io simultaneously over a ten second window.


type: float

format: percent

--

*`linux.pressure.io.full.60.pct`*::
+
--
The average share of time in which in which all non-idle tasks were stalled on io simultaneously over a sixty second window.


type: float

format: percent

--

*`linux.pressure.io.full.300.pct`*::
+
--
The average share of time in which in which all non-idle tasks were stalled on io simultaneously over a three hundred second window.


type: float

format: percent

--

*`linux.pressure.io.full.total.time.us`*::
+
--
The total absolute stall time (in microseconds) in which in which all non-idle tasks were stalled on io.


type: long

--

[[exported-fields-logstash]]
== Logstash fields

Expand Down
5 changes: 5 additions & 0 deletions metricbeat/docs/modules/linux.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ metricbeat.modules:
# - ksm
# - conntrack
# - iostat
# - pressure
enabled: true
#hostfs: /hostfs
Expand All @@ -46,6 +47,8 @@ The following metricsets are available:

* <<metricbeat-metricset-linux-pageinfo,pageinfo>>

* <<metricbeat-metricset-linux-pressure,pressure>>

include::linux/conntrack.asciidoc[]

include::linux/iostat.asciidoc[]
Expand All @@ -56,3 +59,5 @@ include::linux/memory.asciidoc[]

include::linux/pageinfo.asciidoc[]

include::linux/pressure.asciidoc[]

23 changes: 23 additions & 0 deletions metricbeat/docs/modules/linux/pressure.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
////
This file is generated! See scripts/mage/docs_collector.go
////

[[metricbeat-metricset-linux-pressure]]
=== linux pressure metricset

beta[]

include::../../../module/linux/pressure/_meta/docs.asciidoc[]


==== Fields

For a description of each field in the metricset, see the
<<exported-fields-linux,exported fields>> section.

Here is an example document generated by this metricset:

[source,json]
----
include::../../../module/linux/pressure/_meta/data.json[]
----
3 changes: 2 additions & 1 deletion metricbeat/docs/modules_list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,12 @@ This file is generated! See scripts/mage/docs_collector.go
.2+| .2+| |<<metricbeat-metricset-kvm-dommemstat,dommemstat>> beta[]
|<<metricbeat-metricset-kvm-status,status>> beta[]
|<<metricbeat-module-linux,linux>> beta[] |image:./images/icon-no.png[No prebuilt dashboards] |
.5+| .5+| |<<metricbeat-metricset-linux-conntrack,conntrack>> beta[]
.6+| .6+| |<<metricbeat-metricset-linux-conntrack,conntrack>> beta[]
|<<metricbeat-metricset-linux-iostat,iostat>> beta[]
|<<metricbeat-metricset-linux-ksm,ksm>> beta[]
|<<metricbeat-metricset-linux-memory,memory>> beta[]
|<<metricbeat-metricset-linux-pageinfo,pageinfo>> beta[]
|<<metricbeat-metricset-linux-pressure,pressure>> beta[]
|<<metricbeat-module-logstash,Logstash>> |image:./images/icon-no.png[No prebuilt dashboards] |
.2+| .2+| |<<metricbeat-metricset-logstash-node,node>>
|<<metricbeat-metricset-logstash-node_stats,node_stats>>
Expand Down
1 change: 1 addition & 0 deletions metricbeat/include/list_common.go

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

1 change: 1 addition & 0 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ metricbeat.modules:
# - ksm
# - conntrack
# - iostat
# - pressure
enabled: true
#hostfs: /hostfs

Expand Down
1 change: 1 addition & 0 deletions metricbeat/module/linux/_meta/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# - ksm
# - conntrack
# - iostat
# - pressure
enabled: true
#hostfs: /hostfs

2 changes: 1 addition & 1 deletion metricbeat/module/linux/fields.go

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

27 changes: 27 additions & 0 deletions metricbeat/module/linux/pressure/_meta/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"@timestamp": "2017-10-12T08:05:34.853Z",
"event": {
"dataset": "linux.pressure",
"duration": 115000,
"module": "linux"
},
"linux": {
"pressure": {
"cpu": {
"some": {
"10": 1.63,
"300": 0.06,
"60": 0.29,
"total": 155911207
}
}
}
},
"metricset": {
"name": "pressure",
"period": 10000
},
"service": {
"type": "linux"
}
}
1 change: 1 addition & 0 deletions metricbeat/module/linux/pressure/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The Pressure module reports https://www.kernel.org/doc/Documentation/accounting/psi.txt[Pressure Stall Information (PSI)] collected for the `cpu`, `memory`, and `io` files/resources found in `/proc/pressure`. PSI metrics are included in Linux kernel versions from 4.20. Some distributions might have PSI support, but have disabled the feature via the `CONFIG_PSI_DEFAULT_DISABLED` setting, to enable PSI metrics pass `psi=1` on the kernel command line during boot.
Loading

0 comments on commit 8184087

Please sign in to comment.