简体   繁体   中英

How we trace axios http requests with aws x-ray in koa application model

I am using the koa nodejs microservice for my backend. I have deployed everything in AWS environment. I am having all my logs in cloudwatch.

When I was trying to use AWS X-Ray I am able to trace the request in individual services. But I am unable to trace the single request to my service and then adapter in request journey, I have tried subsegment but I am not able to track the adapter call but it calculate the trace for the function only.

Is it possible to trace single request journey in koa with X-ray?

The X-Ray SDK for Node.js does not officially support the Koa framework. You can track this issue on GitHub to see the progress on adding official support.

In the meantime, it is possible to link your request to your downstream service all as part of one trace by including the X-Ray header as a header in your HTTP requests and intercepting it downstream. You can learn about how to construct the header in the docs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM