How is downstreamXRayEnabled used in captureHTTPs?

0

I am looking at the doc here:
https://docs.aws.amazon.com/xray-sdk-for-nodejs/latest/reference/module-http_p.html

There is a downstreamXRayEnabled parameter but I don't think I understand what exactly it does. I looked at the source code to try to understand what it does. All I can see is that it added a traced attribute but it isn't apparent to me how the attribute is used. I also tried searching for usage of it by others but there aren't any meaningful results.

So what's the effect of this flag exactly?

Thanks

lawlau
질문됨 4년 전318회 조회
1개 답변
0
수락된 답변

Hi lawlau,

This flag is consumed by the backend service of X-Ray. It can be set by the user if they know the downstream service(s) being called with the captured HTTP client are instrumented with X-Ray, and will therefore generate their own segments when called. The backend uses it to determine whether traces are incomplete, or "partial," by checking to see if segments exist yet for the downstream service marked with downstreamXRayEnabled. For example, if service A calls service B like so:

// In service A
const https = AWSXRay.captureHTTPs(require('https'), true);
https.get(serviceB, options...);

Then the trace created from that transaction would be marked as partial until it included a segment from serviceB. You can filter by whether a trace is partial in the X-Ray console. Read more about filtering: https://docs.aws.amazon.com/xray/latest/devguide/xray-console-filters.html#console-filters-boolean

This flag is very seldom used by customers and not even implemented in most of our SDKs, since it is basically just a way to give a more strict definition of what is "complete" and what is "partial" for your traces, and it requires you to know which downstream services are instrumented with X-Ray, making it a fairly edge use case. I hope this helps!

AWS
답변함 4년 전

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

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

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

관련 콘텐츠