06 Dec 2022 01:22 PM - edited 07 Dec 2022 03:23 PM
Hi,
I see in the OneAgent SDK documentation that there is a way to get a trace_i and span_id from the TraceContextInfo (https://github.com/Dynatrace/OneAgent-SDK/blob/master/README.md#trace-context)
I may be missing something but I can't find how to do it with the OneAgent SDK for Python.
Is there a way to enrich logs with trace_id and span_id dierctly from a Python script/app ?
Solved! Go to Solution.
07 Dec 2022 05:21 PM
Curious to know too - it seems the TraceContextInfo is implemented only in OneAgent SDK for .NET. OneAgent SDK for Python is based on the SDK for C/C++ which does not have the feature.
I suppose switching to OpenTelemetry is not a simple solution here as you likely already have your code dependent on OneAgent SDK. But in a long term I'd consider switching, since due to Otel being a vendor-angostic standard, OneAgent SDKs won't have much attention anymore.
FYI - @_Alexander_ - are they any plans to get the other SDKs on part with this feature (NodeJS/Java/C++)?
07 Dec 2022 05:33 PM
Funny coincidence 🙂 we just did a POC using OpenTelemetry and decided we'll switch to it.
While searching the Dynatrace documentation we saw that a lot of it have changed toward pointing to Opentelemetry and tried it.
16 Dec 2022 03:40 PM
As @Julius_Loman mentioned - OpenTelemetry would be the immediate way to go. But the good news is that we're bringing TraceContextInfo to C/C++ and Python around the end of January. So, if you can wait until then, that's another way to go.