Skip to content

Conversation

@stefans-elastic
Copy link
Contributor

@stefans-elastic stefans-elastic commented Jan 8, 2026

Proposed commit message

See title

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works. Where relevant, I have used the stresstest.sh script to run them under stress conditions and race detector to verify their stability.
  • I have added an entry in ./changelog/fragments using the changelog tool.

Disruptive User Impact

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

On Linux
Screenshot 2026-01-07 at 15 48 30

Some validation of the output
Screenshot 2026-01-07 at 16 10 27

As is visible on the screenshot process with PID 43 and 90 really used no swap memory. And process with PID 640 used 1272 kB of swap memory (which is 1302528 bytes) and it matches what is shown in Kibana.

To make sure nothing breaks on other platforms I've run a test on macos (it is working fine, swap field is null on other than Linux platforms)
Screenshot 2026-01-08 at 11 26 04

Logs

@stefans-elastic stefans-elastic requested a review from a team as a code owner January 8, 2026 10:34
@stefans-elastic stefans-elastic added the Metricbeat Metricbeat label Jan 8, 2026
@stefans-elastic stefans-elastic requested a review from a team as a code owner January 8, 2026 10:34
@stefans-elastic stefans-elastic added the Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team label Jan 8, 2026
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jan 8, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@mergify
Copy link
Contributor

mergify bot commented Jan 8, 2026

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @stefans-elastic? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

Copy link
Contributor

@orestisfl orestisfl left a comment

Choose a reason for hiding this comment

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

You need to run make update

@stefans-elastic stefans-elastic requested a review from a team as a code owner January 8, 2026 11:31
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

Copy link
Member

@ishleenk17 ishleenk17 left a comment

Choose a reason for hiding this comment

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

1 nit, otherwise looks good.

@mergify
Copy link
Contributor

mergify bot commented Jan 9, 2026

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b process-swap-memory upstream/process-swap-memory
git merge upstream/main
git push upstream process-swap-memory

@stefans-elastic
Copy link
Contributor Author

After giving this some additional thought—and considering that version 9.4 is still quite a while away—should we consider backporting this change, perhaps to 9.3?

cc @ishleenk17

@ishleenk17
Copy link
Member

After giving this some additional thought—and considering that version 9.4 is still quite a while away—should we consider backporting this change, perhaps to 9.3?

cc @ishleenk17

@stefans-elastic : Since the request came from the customer who is on 8.19.
It should be ok to backport it to 8.19 and other active branches.

@stefans-elastic stefans-elastic added the backport-active-all Automated backport with mergify to all the active branches label Jan 19, 2026
@stefans-elastic
Copy link
Contributor Author

/test

@stefans-elastic stefans-elastic merged commit 90844ec into elastic:main Jan 20, 2026
206 checks passed
@github-actions
Copy link
Contributor

@Mergifyio backport 8.19 9.1 9.2 9.3

@mergify
Copy link
Contributor

mergify bot commented Jan 20, 2026

backport 8.19 9.1 9.2 9.3

✅ Backports have been created

Details

Cherry-pick of 90844ec has failed:

On branch mergify/bp/8.19/pr-48334
Your branch is up to date with 'origin/8.19'.

You are currently cherry-picking commit 90844ec02.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   changelog/fragments/1767864511-add-swap-field-to-system.process.memory-metric-set-in-metricbeats.yaml
	modified:   metricbeat/module/system/process/_meta/data.json
	modified:   metricbeat/module/system/process/_meta/fields.yml

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   NOTICE.txt
	deleted by us:   docs/reference/metricbeat/exported-fields-system.md
	deleted by us:   docs/reference/metricbeat/metricbeat-metricset-system-process.md
	both modified:   go.mod
	both modified:   go.sum
	both modified:   metricbeat/module/system/fields.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Cherry-pick of 90844ec has failed:

On branch mergify/bp/9.1/pr-48334
Your branch is up to date with 'origin/9.1'.

You are currently cherry-picking commit 90844ec02.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   changelog/fragments/1767864511-add-swap-field-to-system.process.memory-metric-set-in-metricbeats.yaml
	modified:   docs/reference/metricbeat/exported-fields-system.md
	modified:   docs/reference/metricbeat/metricbeat-metricset-system-process.md
	modified:   metricbeat/module/system/process/_meta/data.json
	modified:   metricbeat/module/system/process/_meta/fields.yml

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   NOTICE.txt
	both modified:   go.mod
	both modified:   go.sum
	both modified:   metricbeat/module/system/fields.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Cherry-pick of 90844ec has failed:

On branch mergify/bp/9.2/pr-48334
Your branch is up to date with 'origin/9.2'.

You are currently cherry-picking commit 90844ec02.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   changelog/fragments/1767864511-add-swap-field-to-system.process.memory-metric-set-in-metricbeats.yaml
	modified:   docs/reference/metricbeat/exported-fields-system.md
	modified:   docs/reference/metricbeat/metricbeat-metricset-system-process.md
	modified:   metricbeat/module/system/process/_meta/data.json
	modified:   metricbeat/module/system/process/_meta/fields.yml

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   NOTICE.txt
	both modified:   go.mod
	both modified:   go.sum
	both modified:   metricbeat/module/system/fields.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Cherry-pick of 90844ec has failed:

On branch mergify/bp/9.3/pr-48334
Your branch is up to date with 'origin/9.3'.

You are currently cherry-picking commit 90844ec02.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   NOTICE.txt
	new file:   changelog/fragments/1767864511-add-swap-field-to-system.process.memory-metric-set-in-metricbeats.yaml
	modified:   docs/reference/metricbeat/exported-fields-system.md
	modified:   docs/reference/metricbeat/metricbeat-metricset-system-process.md
	modified:   metricbeat/module/system/fields.go
	modified:   metricbeat/module/system/process/_meta/data.json
	modified:   metricbeat/module/system/process/_meta/fields.yml

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   go.mod
	both modified:   go.sum

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

mergify bot pushed a commit that referenced this pull request Jan 20, 2026
#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>
(cherry picked from commit 90844ec)

# Conflicts:
#	NOTICE.txt
#	docs/reference/metricbeat/exported-fields-system.md
#	docs/reference/metricbeat/metricbeat-metricset-system-process.md
#	go.mod
#	go.sum
#	metricbeat/module/system/fields.go
mergify bot pushed a commit that referenced this pull request Jan 20, 2026
#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>
(cherry picked from commit 90844ec)

# Conflicts:
#	NOTICE.txt
#	go.mod
#	go.sum
#	metricbeat/module/system/fields.go
mergify bot pushed a commit that referenced this pull request Jan 20, 2026
#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>
(cherry picked from commit 90844ec)

# Conflicts:
#	NOTICE.txt
#	go.mod
#	go.sum
#	metricbeat/module/system/fields.go
mergify bot pushed a commit that referenced this pull request Jan 20, 2026
#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>
(cherry picked from commit 90844ec)

# Conflicts:
#	go.mod
#	go.sum
@stefans-elastic
Copy link
Contributor Author

I've gotten a question:
the intention was to backport this PR to 8.19, 9.1, 9.2, 9.3 (the customer who requested this feature is on 8.19).
The problem is that CI checks on backport PRs for 8.19, 9.1 and 9.2 fail with errors:

FAILED module/system/test_system.py::Test::test_process_unix - Exception: Keys:
['system.process.cgroup.memory.pressure.some.10.pct', 'system.process.cgroup.memory.pressure.some.60.pct', 'system.process.cgroup.memory.pressure.some.300.pct', 'system.process.cgroup.memory.pressure.some.total', 'system.process.cgroup.memory.pressure.full.10.pct', 'system.process.cgroup.memory.pressure.full.60.pct', 'system.process.cgroup.memory.pressure.full.300.pct', 'system.process.cgroup.memory.pressure.full.total']

The error is due to the fact that this PR hasn't bee backported and the functionality is available only in 9.3+.

I don't see a way to backport my PR without bringing the changes from elastic-agent-system-metrics that power #48054 and resolve CI fails.

I assume we have 2 options here:

  1. Backport [Metricbeat] Add memory PSI metrics for cgroupv2 #48054 to 8.19, 9.1, 9.2 (since the PR hasn't been backported yet this seems undesirable).
  2. Backport this current PR to 9.3 only.

Or maybe I'm not seeing a way to backport this PR without bringing changes from elastic-agent-system-metrics that power #48054.

Please advise with the best course of action here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-active-all Automated backport with mergify to all the active branches enhancement Metricbeat Metricbeat Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants