Skip to content

Commit 90844ec

Browse files
[metricbeat][system] add swap field to system.process.memory metricset (#48334)
* [metricbeat][system] add swap field to system.process.memory metricset * update docs * update NOTICE.txt * remove field mapping * make changelog message more accurate * revert removing of field mapping * resolve PR comment * Update metricbeat/module/system/process/_meta/fields.yml Co-authored-by: Colleen McGinnis <colleen.j.mcginnis@gmail.com> * make update * update swap field ga version --------- Co-authored-by: Colleen McGinnis <colleen.j.mcginnis@gmail.com>
1 parent 66bcfb7 commit 90844ec

9 files changed

Lines changed: 71 additions & 9 deletions

File tree

NOTICE.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11175,11 +11175,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-l
1117511175

1117611176
--------------------------------------------------------------------------------
1117711177
Dependency : github.com/elastic/elastic-agent-system-metrics
11178-
Version: v0.13.5
11178+
Version: v0.13.6
1117911179
Licence type (autodetected): Apache-2.0
1118011180
--------------------------------------------------------------------------------
1118111181

11182-
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-system-metrics@v0.13.5/LICENSE.txt:
11182+
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-system-metrics@v0.13.6/LICENSE.txt:
1118311183

1118411184
Apache License
1118511185
Version 2.0, January 2004
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# REQUIRED
2+
# Kind can be one of:
3+
# - breaking-change: a change to previously-documented behavior
4+
# - deprecation: functionality that is being removed in a later release
5+
# - bug-fix: fixes a problem in a previous version
6+
# - enhancement: extends functionality but does not break or fix existing behavior
7+
# - feature: new functionality
8+
# - known-issue: problems that we are aware of in a given version
9+
# - security: impacts on the security of a product or a user’s deployment.
10+
# - upgrade: important information for someone upgrading from a prior version
11+
# - other: does not fit into any of the other categories
12+
kind: enhancement
13+
14+
# REQUIRED for all kinds
15+
# Change summary; a 80ish characters long description of the change.
16+
summary: add swap field to system.process.memory metric set in metricbeat
17+
18+
# REQUIRED for breaking-change, deprecation, known-issue
19+
# Long description; in case the summary is not enough to describe the change
20+
# this field accommodate a description without length limits.
21+
# description:
22+
23+
# REQUIRED for breaking-change, deprecation, known-issue
24+
# impact:
25+
26+
# REQUIRED for breaking-change, deprecation, known-issue
27+
# action:
28+
29+
# REQUIRED for all kinds
30+
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
31+
component: metricbeat
32+
33+
# AUTOMATED
34+
# OPTIONAL to manually add other PR URLs
35+
# PR URL: A link the PR that added the changeset.
36+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
37+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
38+
# Please provide it if you are adding a fragment for a different PR.
39+
# pr: https://github.com/owner/repo/1234
40+
41+
# AUTOMATED
42+
# OPTIONAL to manually add other issue URLs
43+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
44+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
45+
# issue: https://github.com/owner/repo/1234

docs/reference/metricbeat/exported-fields-system.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,14 @@ Memory-specific statistics per process.
10471047
format: bytes
10481048

10491049

1050+
**`system.process.memory.swap`** {applies_to}`stack: ga 8.19.11`
1051+
: The swap memory used by the process (supported only on Linux kernel version 2.6.34+).
1052+
1053+
type: long
1054+
1055+
format: bytes
1056+
1057+
10501058
## io [_io]
10511059

10521060
Disk I/O Metrics, as forwarded from /proc/[PID]/io. Available on Linux only.

docs/reference/metricbeat/metricbeat-metricset-system-process.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,8 @@ Here is an example document generated by this metricset:
395395
"pct": 0.0008
396396
},
397397
"share": 16252928,
398-
"size": 1886003200
398+
"size": 1886003200,
399+
"swap": 1302528
399400
},
400401
"num_threads": 9,
401402
"state": "sleeping"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ require (
173173
github.com/elastic/ebpfevents v0.8.0
174174
github.com/elastic/elastic-agent-autodiscover v0.10.0
175175
github.com/elastic/elastic-agent-libs v0.31.0
176-
github.com/elastic/elastic-agent-system-metrics v0.13.5
176+
github.com/elastic/elastic-agent-system-metrics v0.13.6
177177
github.com/elastic/go-elasticsearch/v8 v8.19.0
178178
github.com/elastic/go-freelru v0.16.0
179179
github.com/elastic/go-quark v0.3.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,8 @@ github.com/elastic/elastic-agent-client/v7 v7.15.0 h1:nDB7v8TBoNuD6IIzC3z7Q0y+7b
379379
github.com/elastic/elastic-agent-client/v7 v7.15.0/go.mod h1:6h+f9QdIr3GO2ODC0Y8+aEXRwzbA5W4eV4dd/67z7nI=
380380
github.com/elastic/elastic-agent-libs v0.31.0 h1:3i/a0n40VPpx+vyB6oBZkTpcsjEGd2LKBiJjSI//j38=
381381
github.com/elastic/elastic-agent-libs v0.31.0/go.mod h1:0xUg7alsNE/WhY9DZRIdTYW75nqSHC1octIAg//j/PQ=
382-
github.com/elastic/elastic-agent-system-metrics v0.13.5 h1:VPTkk3C0ixsgqhAS2S++0/BKe+X6tYn+GzHbBLVuiO4=
383-
github.com/elastic/elastic-agent-system-metrics v0.13.5/go.mod h1:JNfnZrC0viAjlJRUzQKKuMpDlXgjXBn4WdWEXQF7jcA=
382+
github.com/elastic/elastic-agent-system-metrics v0.13.6 h1:Gwy3siqs5aHAP6RlLXel/irnedXvqdQ+tAzPq/2QOlY=
383+
github.com/elastic/elastic-agent-system-metrics v0.13.6/go.mod h1:JNfnZrC0viAjlJRUzQKKuMpDlXgjXBn4WdWEXQF7jcA=
384384
github.com/elastic/elastic-transport-go/v8 v8.8.0 h1:7k1Ua+qluFr6p1jfJjGDl97ssJS/P7cHNInzfxgBQAo=
385385
github.com/elastic/elastic-transport-go/v8 v8.8.0/go.mod h1:YLHer5cj0csTzNFXoNQ8qhtGY1GTvSqPnKWKaqQE3Hk=
386386
github.com/elastic/fsevents v0.0.0-20181029231046-e1d381a4d270 h1:cWPqxlPtir4RoQVCpGSRXmLqjEHpJKbR60rxh1nQZY4=

metricbeat/module/system/fields.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

metricbeat/module/system/process/_meta/data.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@
288288
"pct": 0.0008
289289
},
290290
"share": 16252928,
291-
"size": 1886003200
291+
"size": 1886003200,
292+
"swap": 1302528
292293
},
293294
"num_threads": 9,
294295
"state": "sleeping"
@@ -297,4 +298,4 @@
297298
"user": {
298299
"name": "alexk"
299300
}
300-
}
301+
}

metricbeat/module/system/process/_meta/fields.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@
111111
format: bytes
112112
description: >
113113
The shared memory the process uses.
114+
- name: swap
115+
type: long
116+
format: bytes
117+
version:
118+
ga: 8.19.11
119+
description: >
120+
The swap memory used by the process (supported only on Linux kernel version 2.6.34+).
114121
- name: io
115122
type: group
116123
description: Disk I/O Metrics, as forwarded from /proc/[PID]/io. Available on Linux only.

0 commit comments

Comments
 (0)