X-Ray Python SDK - threading

0

Hello everyone,

I have wrote an application which opens threads and distributes jobs via a queue (python, subprocess). From reading the docs, which for Java call out this use-case specifically, but not for python, I can't figure out how to make sure that traces created in threads inherit the segments, even if they create they own subsegment, in python. I found some GitHub issues and PRs, all of them closed with no obvious (to me anyways) solutions for people to pick this up.

Hoping someone has found a solution they are happy to solve this issue.

No segment found, cannot begin subsegment localhost.
cannot find the current segment/subsegment, please make sure you have a segment open

Also, follow-up question: there seem to be a big push for using the ADOT libraries. Is that accurate?

profile picture
asked a year ago432 views
2 Answers
0

The Python SDK has some documentation on how to set the trace entity in worker threads, have you tried following this example?

The ADOT libraries use OpenTelemetry which contains a large variety of library instrumentations which are listed here. If you are trying to instrument any of the libraries in this list that may not have instrumentation support in the X-Ray SDK, then ADOT would be a great option to look into!

AWS
Carol_A
answered a year ago
0

X-Ray data model is service-oriented, that drives XRay SDK design: Segment represents a service, is rendered as a node in X-Ray console. So X-Ray sdk user has to wrap subsegment with a segment.

OTel data model is operartion-oriented, OTel SDK is designed as vendor-agnostic, it does not rely on service UX, so it does not force user wrap a span with a service span.

That is just different design philosophy, not the big reason XRay is going to move to OTel. The reason X-Ray support OTel because OTel is a powerful open source project, user can get more contributors' support from community.

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions