Skip to content

Fetch per process swap memory data (linux)#277

Merged
orestisfl merged 6 commits intoelastic:mainfrom
stefans-elastic:process-swap-memory
Jan 7, 2026
Merged

Fetch per process swap memory data (linux)#277
orestisfl merged 6 commits intoelastic:mainfrom
stefans-elastic:process-swap-memory

Conversation

@stefans-elastic
Copy link
Copy Markdown
Contributor

What does this PR do?

Add collection of data on how much swap memory monitored process is using. This is achieved by parsing of /proc/[pid]/status and getting value of VmSwap field. The value in the field is in KB units so we also convert original value to bytes.
This is linux implementation. Implementations for windows and macos will be implemented in separate PRs.

Why is it important?

This change is needed because we've received a customer request to add this feature.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.md

Author's Checklist

  • [ ]

Related issues

@stefans-elastic stefans-elastic requested a review from a team as a code owner December 22, 2025 08:46
@stefans-elastic stefans-elastic requested review from andrzej-stencel and faec and removed request for a team December 22, 2025 08:46
Copy link
Copy Markdown
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.

  • Can we get a issue link here? I want to make sure there's no conflict with elastic/beats#47605 (doesn't look like it).
  • Can you also include an integration test? You can use os.Getpid() to use the test process' pid.

@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Dec 22, 2025
andrzej-stencel
andrzej-stencel previously approved these changes Jan 5, 2026
Copy link
Copy Markdown

@andrzej-stencel andrzej-stencel left a comment

Choose a reason for hiding this comment

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

Thanks Stefan! Looks good to me.

@orestisfl orestisfl merged commit 63ecc78 into elastic:main Jan 7, 2026
5 checks passed
@stefans-elastic stefans-elastic mentioned this pull request Jan 23, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants