01 May 2025 01:06 AM
Does anyone from Dynatrace engineering (or anyone) have a concrete code example that shows how a Python application can be manually instrumented with OpenTelemetry libraries but have the integration orchestrated by the OneAgent and not use any OTLP export?
Using this documentation link, https://docs.dynatrace.com/docs/shortlink/opentelemetry-oneagent
it seems like the instruction is focused on enabling the feature support in the Dynatrace UI.
In other parts of the Dynatrace documentation, the OTLP export method for Python is explained with code examples. We've successfully got an OTLP export trial working (yay!) , but we are unable to get the OneAgent integration working (traces never show up in Dynatrace).
So, I'm looking for a simple code exemplar from Dyantrace that shows how a Python app (would be great if it was FastAPI) would be instrumented for OneAgent integration.
My platform requirements are AWS EKS or AWS ROSA and I've enabled the oneagent.dynatrace.com/inject: "true"
annotation on the pod, and the code module injection seems to be working (good read-out from `k describe pod ...`) but the tracing instrumentation fails to produce any traces in Dynatrace. With basically the same Python demo app, OTLP export works without issues.
So again, looking for any fully-baked code example, however simple, to show me that this technology actually works and what I might have wrong in my instrumentation code.
thanks in advance!
07 May 2025 08:49 PM
Hi,
When you inject the OA into your Python application, you can use our OneAgent span sensor to automatically capture spans created via OpenTelemetry without needing to send them via API.
Check this link for more details: https://docs.dynatrace.com/docs/ingest-from/opentelemetry/getting-started/traces/oneagent#expand--op...
There's no need to specify anything additional in the code.
For further assistance, ask our AE/CSM for a session with our ACE Service Team to get help with it. There are some extra configurations on the Dynatrace UI as shown in the documentation.