Adding a custom Python package to the Agent
Datadog's Research Report: The State of Serverless Report: The State of Serverless

Adding a custom Python package to the Agent

The Agent contains an embedded Python environment at /opt/datadog-agent/embedded/. Common binaries such as python and pip are contained within /opt/datadog-agent/embedded/bin/.

Python packages can be installed via the embedded pip:

sudo -Hu dd-agent /opt/datadog-agent/embedded/bin/pip install <PACKAGE_NAME>

The Agent contains an embedded Python environment at /opt/datadog-agent/embedded/. Common binaries such as python and pip are contained within /opt/datadog-agent/embedded/bin/.

Python packages can be installed via the embedded pip:

sudo /opt/datadog-agent/embedded/bin/pip install <PACKAGE_NAME>

Custom Python packages can be installed using the Agent’s embedded Python using the following command in PowerShell:

For Agent versions <= 6.11:

%PROGRAMFILES%\Datadog\"Datadog Agent"\embedded\python -m pip install <PACKAGE_NAME>

For Agent versions >= 6.12:

%PROGRAMFILES%\Datadog\"Datadog Agent"\embedded<PYTHON_MAJOR_VERSION>\python -m pip install <PACKAGE_NAME>

Or the package can be added in the library zipped folder that can be found at

%PROGRAMFILES%\Datadog\Datadog Agent\files

then restart your Agent.

Further Reading