OOM Kill: Docker documentation missing `CAP_PERFMON` capability for Linux Kernel >= 5.8

Open Beginner friendly
#24,060 0 comments 0 reactions 0 assignees View on GitHub

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

oss/0 pending team/agent-integrations

Current State

The OOM Kill README states, under "Configuration with Docker":

From kernel version 5.8, the --privileged parameter 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 --privileged parameter 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DataDog/integrations-core

All issues in DataDog/integrations-core

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.