09 Jul 2025 10:24 AM
To ensure successful instrumentation of your Python application with OneAgent, follow these essential configuration steps:
Navigate to:
Settings → Monitoring → Monitored technologies → Python
Make sure the "Monitor Python" option is enabled.
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.
Go to:
Settings → Processes and containers → Process group monitoring
Ensure automatic deep monitoring is enabled.
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.
For PaaS setups using OneAgent versions prior to 1.315, manual configuration is required.
In the ruxitagentproc.conf file, add:
[agentType]
python on
[general]
pythonInjection on
Example Dockerfile Snippet:
# Install Dynatrace OneAgent
COPY --from=tenant.live.dynatrace.com/linux/oneagent-codemodules:python / /
ENV LD_PRELOAD /opt/dynatrace/oneagent/agent/lib64/liboneagentproc.so
ENV DT_AGENTTYPE_OVERRIDE python=on
# Append Python settings to ruxitagentproc.conf
RUN echo -e "[agentType]\npython on\n\n[general]\npythonInjection on" >> /opt/ruxitagentproc.conf
Please make sure that you are using supported python version CPython 3.8-3.13 List of supported python frameworks here: https://docs.dynatrace.com/docs/shortlink/section-technology-support#python
For further informations about python module please see our documentation here: https://docs.dynatrace.com/docs/shortlink/python
08 Sep 2025 02:15 PM
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".