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
已提问 1 年前456 查看次数
2 回答
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
已回答 1 年前
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.

已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则