# How to get the trace\_id and span\_id using the OneAgent SDK for Python?

**URL:** <https://community.dynatrace.com/t/how-to-get-the-trace-id-and-span-id-using-the-oneagent-sdk-for-python/37590>\
**Category:** Extensions\
**Tags:** python, oneagent-sdk\
**Created:** [December 6, 2022, 1:22pm UTC](https://community.dynatrace.com/t/how-to-get-the-trace-id-and-span-id-using-the-oneagent-sdk-for-python/37590 "2022-12-06T13:22:04Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![arlindo](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/arlindo/32/16085_2.png) [@arlindo](https://community.dynatrace.com/u/arlindo)\
**Post date:** [December 16, 2022, 3:40pm UTC](https://community.dynatrace.com/t/how-to-get-the-trace-id-and-span-id-using-the-oneagent-sdk-for-python/37590/4 "2022-12-16T15:40:40Z")

</div>

As&nbsp;[@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp;mentioned - OpenTelemetry would be the immediate way to go. But the good news is that we’re bringing&nbsp;TraceContextInfo&nbsp;to C/C++ and Python around the end of January. So, if you can wait until then, that’s another way to go.

---

_[View the full topic](https://community.dynatrace.com/t/how-to-get-the-trace-id-and-span-id-using-the-oneagent-sdk-for-python/37590)._
