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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南