[8.19](backport #48054) [Metricbeat] Add memory PSI metrics for cgroupv2#49055
Merged
[8.19](backport #48054) [Metricbeat] Add memory PSI metrics for cgroupv2#49055
Conversation
## Proposed commit message
Add memory pressure PSI metrics to the system.process.cgroup.memory
metricset, complementing the existing CPU and IO pressure metrics.
New fields added under system.process.cgroup.memory.pressure:
- pressure.some.{10,60,300}.pct - Share of time with some tasks stalled
- pressure.some.total - Total some pressure time
- pressure.full.{10,60,300}.pct - Share of time with all tasks stalled
- pressure.full.total - Total full pressure time
Closes #47604
## How to test this PR locally
### 1. Build and Run Metricbeat
```bash
cd metricbeat
go build .
```
### 2. Create Test Configuration
```yaml
metricbeat.modules:
- module: system
period: 5s
metricsets:
- process
processes: ['.*']
process.cgroups.enabled: true
output.console:
pretty: true
```
### 3. Run Metricbeat
```bash
./metricbeat -e -c /tmp/metricbeat-psi-test.yml
```
### 4. Verify Memory Pressure Fields
Look for `system.process.cgroup.memory.pressure` in the output:
```json
"memory": {
"pressure": {
"some": {
"10": { "pct": 0 },
"60": { "pct": 0 },
"300": { "pct": 0 },
"total": 0
},
"full": {
"10": { "pct": 0 },
"60": { "pct": 0 },
"300": { "pct": 0 },
"total": 0
}
}
}
```
### 5. Compare Before/After (Optional)
[compare-psi-metrics.sh](https://github.com/user-attachments/files/24191696/compare-psi-metrics.sh)
Use the comparison script to compare output from main vs this PR:
```
compare-psi-metrics.sh
Usage: ./compare-psi-metrics.sh <main-output.ndjson> <pr-output.ndjson>
```
## Related issues
- Requires elastic/elastic-agent-system-metrics#274
- Closes #47604
(cherry picked from commit c3f35a9)
# 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
Contributor
Author
|
Cherry-pick of c3f35a9 has failed: 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 |
5 tasks
Contributor
🤖 GitHub commentsJust comment with:
|
Contributor
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
Contributor
Vale Linting ResultsSummary: 5 warnings, 23 suggestions found
|
| File | Line | Rule | Message |
|---|---|---|---|
| docs/reference/metricbeat/exported-fields-system.md | 719 | Elastic.DontUse | Don't use 'please'. |
| docs/reference/metricbeat/exported-fields-system.md | 2077 | Elastic.DontUse | Don't use 'very'. |
| docs/reference/metricbeat/exported-fields-system.md | 2351 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'using' instead of 'via'. |
| docs/reference/metricbeat/exported-fields-system.md | 2359 | Elastic.QuotesPunctuation | Put punctuation outside the quotation marks. |
| docs/reference/metricbeat/exported-fields-system.md | 2359 | Elastic.QuotesPunctuation | Put punctuation outside the quotation marks. |
💡 Suggestions (23)
| File | Line | Rule | Message |
|---|---|---|---|
| docs/reference/metricbeat/exported-fields-system.md | 25 | Elastic.Wordiness | Consider using 'because' instead of 'since'. |
| docs/reference/metricbeat/exported-fields-system.md | 199 | Elastic.Repetition | "might" is repeated. |
| docs/reference/metricbeat/exported-fields-system.md | 199 | Elastic.WordChoice | Consider using 'run, start' instead of 'execute', unless the term is in the UI. |
| docs/reference/metricbeat/exported-fields-system.md | 425 | Elastic.WordChoice | Consider using 'can, might' instead of 'may', unless the term is in the UI. |
| docs/reference/metricbeat/exported-fields-system.md | 471 | Elastic.Repetition | "of" is repeated. |
| docs/reference/metricbeat/exported-fields-system.md | 691 | Elastic.WordChoice | Consider using 'refer to (if it's a document), view (if it's a UI element)' instead of 'see', unless the term is in the UI. |
| docs/reference/metricbeat/exported-fields-system.md | 975 | Elastic.Wordiness | Consider using 'because' instead of 'since'. |
| docs/reference/metricbeat/exported-fields-system.md | 981 | Elastic.Wordiness | Consider using 'because' instead of 'since'. |
| docs/reference/metricbeat/exported-fields-system.md | 989 | Elastic.Wordiness | Consider using 'because' instead of 'since'. |
| docs/reference/metricbeat/exported-fields-system.md | 1142 | Elastic.OxfordComma | Use the Oxford comma in 'schedulers, CFS and RT.'. |
| docs/reference/metricbeat/exported-fields-system.md | 1142 | Elastic.Wordiness | Consider using 'also' instead of 'In addition'. |
| docs/reference/metricbeat/exported-fields-system.md | 1227 | Elastic.Versions | Use 'or later' instead of 'or higher' when referring to versions. |
| docs/reference/metricbeat/exported-fields-system.md | 1251 | Elastic.Wordiness | Consider using 'all' instead of 'all of '. |
| docs/reference/metricbeat/exported-fields-system.md | 2077 | Elastic.WordChoice | Consider using 'can, might' instead of 'may', unless the term is in the UI. |
| docs/reference/metricbeat/metricbeat-metricset-system-process.md | 25 | Elastic.WordChoice | Consider using 'refer to (if it's a document), view (if it's a UI element)' instead of 'See', unless the term is in the UI. |
| docs/reference/metricbeat/metricbeat-metricset-system-process.md | 38 | Elastic.WordChoice | Consider using 'deactivate, deselect, hide, turn off' instead of 'disable', unless the term is in the UI. |
| docs/reference/metricbeat/metricbeat-metricset-system-process.md | 51 | Elastic.WordChoice | Consider using 'deactivated, deselected, hidden, turned off, unavailable' instead of 'disabled', unless the term is in the UI. |
| docs/reference/metricbeat/metricbeat-metricset-system-process.md | 78 | Elastic.WordChoice | Consider using 'deactivate, deselect, hide, turn off' instead of 'disable', unless the term is in the UI. |
| docs/reference/metricbeat/metricbeat-metricset-system-process.md | 81 | Elastic.Wordiness | Consider using 'to' instead of 'in order to'. |
| docs/reference/metricbeat/metricbeat-metricset-system-process.md | 84 | Elastic.WordChoice | Consider using 'deactivate, deselect, hide, turn off' instead of 'disable', unless the term is in the UI. |
| docs/reference/metricbeat/metricbeat-metricset-system-process.md | 95 | Elastic.WordChoice | Consider using 'refer to (if it's a document), view (if it's a UI element)' instead of 'see', unless the term is in the UI. |
| docs/reference/metricbeat/metricbeat-metricset-system-process.md | 97 | Elastic.WordChoice | Consider using 'refer to (if it's a document), view (if it's a UI element)' instead of 'see', unless the term is in the UI. |
| docs/reference/metricbeat/metricbeat-metricset-system-process.md | 103 | Elastic.WordChoice | Consider using 'refer to (if it's a document), view (if it's a UI element)' instead of 'see', unless the term is in the UI. |
The Vale linter checks documentation changes against the Elastic Docs style guide.
To use Vale locally or report issues, refer to Elastic style guide for Vale.
rdner
approved these changes
Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed commit message
Add memory pressure PSI metrics to the system.process.cgroup.memory
metricset, complementing the existing CPU and IO pressure metrics.
New fields added under system.process.cgroup.memory.pressure:
Closes #47604
Checklist
I have made corresponding change to the default configuration filesstresstest.shscript to run them under stress conditions and race detector to verify their stability../changelog/fragmentsusing the changelog tool.How to test this PR locally
1. Build and Run Metricbeat
2. Create Test Configuration
3. Run Metricbeat
4. Verify Memory Pressure Fields
Look for
system.process.cgroup.memory.pressurein the output:5. Compare Before/After (Optional)
compare-psi-metrics.sh
Use the comparison script to compare output from main vs this PR:
Related issues
This is an automatic backport of pull request #48054 done by [Mergify](https://mergify.com).