How to enable Python Applications monitoring with OneAgent native support

To ensure successful instrumentation of your Python application with OneAgent, follow these essential configuration steps:

1. Enable Python Monitoring​

Navigate to:

Settings → Monitoring → Monitored technologies → Python

Make sure the “Monitor Python” option is enabled.

2. Enable Your Python Framework​

If you’re using a specific framework like FastAPI, ensure it’s enabled under:

Settings → Preferences → OneAgent Features

Look for “Python FastAPI [Opt-In]” and enable it.

3. Enable Process Group Monitoring​

Go to:

Settings → Processes and containers → Process group monitoring

Ensure automatic deep monitoring is enabled.

4. [optional] Set Custom Monitoring Rules (not needed if running in container)​

If your application isn’t automatically detected, define a custom rule:

Settings → Processes and containers → Custom process monitoring rules

This helps Dynatrace identify and monitor your Python processes correctly.

5. [optional] Special Note for PaaS Installations (Pre-1.315)​

For PaaS setups using OneAgent versions prior to 1.315, manual configuration is required.

In the ruxitagentproc.conf file, add:

[agentType]<br>python on<br><br>[general]<br>pythonInjection on

Example Dockerfile Snippet:​

# Install Dynatrace OneAgent<br>COPY --from=tenant.live.dynatrace.com/linux/oneagent-codemodules:python / /<br>ENV LD_PRELOAD /opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so<br>ENV DT_AGENTTYPE_OVERRIDE python=on<br><br># Append Python settings to ruxitagentproc.conf<br>RUN echo -e "[agentType]\npython on\n\n[general]\npythonInjection on" >> /opt/ruxitagentproc.conf

Python version​

Please make sure that you are using supported python version CPython 3.8-3.13 List of supported python frameworks here: Technology support — Dynatrace Docs

For further informations about python module please see our documentation here: Python — Dynatrace Docs

8 Likes

Tip for anyone setting this up - for some reason Dynatrace UI does not report anything in case injection fails, like it does for all other processes. At least in my case I had to dig through the OA logs to find out that injection failed due to unsupported Python version. But there was no feedback in the UI. Normally I’d expect to see a message under the process such as “Activation of deep monitoring was unsuccessful”.

Supported OS/Python version/frameworks​

Please make sure that you are using supported python version CPython 3.8-3.13 List of supported python frameworks here: Technology support — Dynatrace Docs

Python runtime Versions Platforms

CPython 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 Alpine Linux 64-bit (x86-64, ARM64 (AArch64)), Linux (x86-64, ARM64 (AArch64))

Note: Native Python support on Windows is not available in OneAgent. If your application relies on native Python execution, consider alternative deployment strategies or supported environments.