Search code examples
amazon-web-servicesdockeramazon-ecsaws-xray

On AWS X-Ray, stop tracing a particular path on a Node API running in a docker container on ECS


I have a Node API running inside a docker container on ECS. I am using X-Ray to trace incoming requests.

I would like to instruct x-ray to not trace a particular API end-point on my Node API. Is this possible?

The API endpoint is:

/api/upload/directUploadConfirmation

I do not want that end-point traced via X-Ray.

What I have tried

I tried to create a sampling rule via the X-Ray console. I wanted to cheat and see for this paritular URL, capture 0 requests per second. But that plan failed because it doesn't accept 0, the number has to be greater than or equal to 1.

added image


Solution

  • EDIT: The CloudWatch console team has since fixed this in production. Thanks for finding this issue!

    =============================================================

    Just to confirm, are you using the X-Ray SDK for Node.JS? If you are, feel free to open an issue there so people familiar with the SDK can help answer your question too!

    Otherwise, I was able to create a sampling rule with 0 Reservoir Size and 0 Fixed Rate. Below is a picture showing how to get to the X-Ray console to create this.

    X-Ray console for creating a sampling rule

    The AWS documentation lists several Sampling options that you can use including URL Path. This option is not available in APIGW, but should be available in ECS which you mentioned you are using. In my image I am using that to filter output requests to URL Path /foo/bar.

    But that plan failed because it doesn't accept 0, the number has to be greater than or equal to 1.

    Can you please confirm where you saw it fail to accept 0? Based on that I can try to replicate your setup and see if I get the same issue.

    Thanks!