Search code examples
amazon-web-servicesaws-api-gatewayaws-xray

Exclude query parameters from API Gateway's X-Ray tracing logs


I have an AWS Lambda function which has many integrations with an AWS API Gateway API. The API has Enable X-Ray Tracing checked and traces are correctly populating.

Under "AWS X-Ray Dashboard > Traces > Trace overview", I group the traces by "URL". However, the users of the API make requests with query parameters which are unique URLs based only on the query parameters themselves.

For instance, there is a route /plans which a user will make a request to using two query parameters, token=abc123&timestamp=159501493. Since something as unique as a timestamp is included in the query parameters, no traces will be grouped together, leading to hundreds of /plans traces with varying timestamps. The high volume of traces makes any attempt to glean useful information from X-Ray's traces impossible.

I have disabled X-Ray tracing in the meantime. Now, is there any solution for this issue, or am I out of luck until the AWS developers implement a fix for this ?


Solution

  • UPDATE: 03/05 - This change should be out and available for all customers.

    We apologize for the difficulties you've encountered. APIGW and other X-Ray integrated services record and send data independently to the X-Ray service, so unfortunately there is no way to provide a work-around for you right now.

    I have opened an issue with the APIGW team to have this addressed. Sorry again for the issue, I will update when I have more information.

    Sandra