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

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

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

回答問題指南