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
posta 4 anni fa318 visualizzazioni
1 Risposta
0
Risposta accettata

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
con risposta 4 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande