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
asked 4 years ago312 views
1 Answer
0
Accepted Answer

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
answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions

Relevant content