Tips for Manual X-Ray Instrumentation of Java App

0

Hi,

We're trying to instrument our services using AWS X-Ray. Most of the app that we're interested in instrumenting doesn't get passed X-Ray trace ids but instead are called every quarter of a second via a timer to generate data and then pass downstream to another service (via TCP) before sending to clients over websockets. As far as we have found this requires manual instrumentation and we have setup the app to create a segment, create subsegments for parts of the code we would like to additionally instrument before passing the trace-id and parent-id downstream for the other services to pick up and continue using for their own subsegments.

Running the app locally we can see X-Ray trace information in the dashboard and all appears okay. From reading the documentation however, it's unclear whether this is enough or whether we need to do additional work to ensure we're picking up the sampling rules or whether this is something the AWS-SDK will be doing automatically. It is also unclear whether we need to pass more than the trace-id and parent-id downstream as I have seen in some of the examples also passing a flag indicating whether the current trace is being actively traced. If anyone can let me know the ideal way of manually generating traces and passing between services that'd be extremely helpful.

Regards

질문됨 2년 전549회 조회
1개 답변
0

Hi,

XRay SDK provides APIs and dependencies to automatically handle context propagation between services. The sampled flag is a part of trace context, refer to xray concept trace header. By default, XRay SDK uses 1/second + 5% sampling rate, user no need manually set sampled flag.

A good way to start onboard tracing system is from opentelemetry doc. Basically all of SDKs are same, provide ready-to-use APIs that no need SDK user to manually handle trace id, segment id, sampled flag and context propagation between services. Please check the user doc and start from a sample app.

AWS
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠