Skip to content

[8.19](backport #48054) [Metricbeat] Add memory PSI metrics for cgroupv2#49055

Merged
rdner merged 4 commits into8.19from
mergify/bp/8.19/pr-48054
Feb 24, 2026
Merged

[8.19](backport #48054) [Metricbeat] Add memory PSI metrics for cgroupv2#49055
rdner merged 4 commits into8.19from
mergify/bp/8.19/pr-48054

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify bot commented Feb 24, 2026

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

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.

How to test this PR locally

1. Build and Run Metricbeat

cd metricbeat
go build .

2. Create Test Configuration

metricbeat.modules:
- module: system
  period: 5s
  metricsets:
    - process
  processes: ['.*']
  process.cgroups.enabled: true

output.console:
  pretty: true

3. Run Metricbeat

./metricbeat -e -c /tmp/metricbeat-psi-test.yml

4. Verify Memory Pressure Fields

Look for system.process.cgroup.memory.pressure in the output:

"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
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


This is an automatic backport of pull request #48054 done by [Mergify](https://mergify.com).

## 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
@mergify mergify bot requested review from a team as code owners February 24, 2026 10:00
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Feb 24, 2026
@mergify
Copy link
Copy Markdown
Contributor Author

mergify bot commented Feb 24, 2026

Cherry-pick of c3f35a9 has failed:

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

You are currently cherry-picking commit c3f35a907.
  (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/1765878935-metricbeat-cgroup-memory-pressure.yaml
	modified:   metricbeat/module/system/process/_meta/data.json
	modified:   metricbeat/module/system/process/_meta/fields.yml
	modified:   metricbeat/module/system/process/process_test.go

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

@mergify mergify bot requested review from belimawr and rdner and removed request for a team February 24, 2026 10:00
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Feb 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

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

@github-actions github-actions bot added enhancement Team:Docs Label for the Observability docs team Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels Feb 24, 2026
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Feb 24, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 24, 2026

Vale Linting Results

Summary: 5 warnings, 23 suggestions found

⚠️ Warnings (5)
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 rdner requested review from rdner and removed request for a team and belimawr February 24, 2026 10:05
@rdner rdner assigned rdner and unassigned orestisfl Feb 24, 2026
@rdner rdner enabled auto-merge (squash) February 24, 2026 10:05
@rdner rdner merged commit 890abdb into 8.19 Feb 24, 2026
52 checks passed
@rdner rdner deleted the mergify/bp/8.19/pr-48054 branch February 24, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport conflicts There is a conflict in the backported pull request enhancement Team:Docs Label for the Observability docs team 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.

3 participants