OOM Kill: Docker documentation missing `CAP_PERFMON` capability for Linux Kernel >= 5.8
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 82/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- docker, linux
- Domain
- documentation
Research direction
Open oom_kill/README.md and find the "Configuration with Docker" section. Update the Linux kernel 5.8-and-newer note and Docker example to document both CAP_BPF and CAP_PERFMON; done means the README no longer presents CAP_BPF alone as sufficient.
Written by the indexing model from the issue text.
Description
Current State
The OOM Kill README states, under "Configuration with Docker":
From kernel version 5.8, the
--privilegedparameter can be replaced by--cap-add CAP_BPF.
This is incomplete. CAP_BPF alone is insufficient to run the OOM Kill check.
Reproducible Steps
Run the datadog-agent container on a Linux host with kernel >= 5.8 following the documented Docker configuration and using CAP_BPF in place of --privileged:
docker run \
--name datadog-agent \
--cap-add CAP_BPF \
-v /sys/kernel/debug:/sys/kernel/debug \
-v /lib/modules:/lib/modules \
-v /usr/src:/usr/src \
-e DD_API_KEY=<DD_API_KEY> \
-e DD_HOSTNAME=test-oom-kill \
-e DD_SYSTEM_PROBE_ENABLED=true \
-e DD_SYSTEM_PROBE_CONFIG_ENABLE_OOM_KILL=true \
public.ecr.aws/datadog/agent:latest
Observed result: The following error appears in the agent logs:
2026-06-16 05:19:57 UTC | CORE | ERROR | (pkg/collector/worker/check_logger.go:71 in Error) | check:oom_kill | Error running check: non-ok status code: url http://sysprobe/oom_kill_probe/check, status_code: 404, response: `404 page not found`
Why this happens: On kernel >= 5.8, CAP_SYS_ADMIN was split into more granular capabilities. Loading an eBPF program requires CAP_BPF, but attaching a kprobe (which oom_kill_probe does via kprobe/oom_kill_process) additionally requires CAP_PERFMON. With only CAP_BPF, the probe fails to attach, system-probe skips registering the /oom_kill_probe/check HTTP route entirely, and the agent check receives a 404.
Desired State
The documentation should reflect that both capabilities are required on kernel >= 5.8:
docker run \
--name datadog-agent \
--cap-add CAP_BPF \
--cap-add CAP_PERFMON \
-v /sys/kernel/debug:/sys/kernel/debug \
-v /lib/modules:/lib/modules \
-v /usr/src:/usr/src \
-e DD_API_KEY=<DD_API_KEY> \
-e DD_HOSTNAME=test-oom-kill \
-e DD_SYSTEM_PROBE_ENABLED=true \
-e DD_SYSTEM_PROBE_CONFIG_ENABLE_OOM_KILL=true \
public.ecr.aws/datadog/agent:latest
The corrected note in the README should read:
From kernel version 5.8, the
--privilegedparameter can be replaced by--cap-add CAP_BPF --cap-add CAP_PERFMON.
Test Results
With the latter configuration OOM Kill events and metrics will be sent to datadog. This can be tested by running a command such as stress-ng --vm 2 --vm-bytes 1900m --timeout 120
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 1.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 196
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DataDog/integrations-core
-
team/saas-integrations
Difficulty 1/5 Under an hour Newbie friendliness 92/100
DataDog/integrations-core#24222 ·
-
oss/0 team/agent-integrations
Difficulty 1/5 Under an hour Newbie friendliness 92/100
DataDog/integrations-core#24218 ·
-
oss/0 pending team/container-integrations
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
DataDog/integrations-core#24068 ·
-
oss/3 team/agent-integrations waiting on author
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
DataDog/integrations-core#18319 · 1 comment ·
-
oss/3 team/ndm-integrations waiting on author
Difficulty 1/5 Under an hour Newbie friendliness 74/100
DataDog/integrations-core#16952 · 1 comment ·
All issues in DataDog/integrations-core
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100