In Python XRay sdk it is possible to turn off XRay via environment variable AWS_XRAY_SDK_ENABLED (https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-python-configuration.html)
Would it be possible to add this feature also to node SDK?
Thanks
Hi ivanmartos,
We're been slowly filling in the gaps of feature parity between our SDKs. This is absolutely a great little feature we should implement on the Node SDK. We'll be happy to add this on our TODO list and prioritize it accordingly, but feel free to open a PR.
I'm using serverless-offline to test my app locally and having xray blow it up is very inconvenient.
```
.../backend/node_modules/serverloffline: Failure: Missing AWS Lambda trace data for X-Ray. Expected _X_AMZN_TRACE_ID to be set.
[start:backend] ess-offline/dist/lambda/handler-runner/in-process-runner/InProcessRunner.js:199:24)
[start:backend] at LambdaFunction.runHandler (/Users/cyber/dev/jb/jkv2-demo/ts-sls/packages/backend/node_modules/serverless-offline/dist/lambda/LambdaFunction.js:325:20)
[start:backend] at hapiHandler (/Users/cyber/dev/jb/jkv2-demo/ts-sls/packages/backend/node_modules/serverless-offline/dist/events/http/HttpServer.js:521:18)
````
@revmischa yes we've had several issues for various serverless packages in this regard.
You should be able to use the "AWS_XRAY_CONTEXT_MISSING" environment variable set to "LOG_ERROR" to merely log these missing context issues.
https://github.com/aws/aws-xray-sdk-node/tree/master/packages/core#environment-variables
Considering that serverless seems like a core use case for XRay and that this request has been open for over a year, is there an expected ETA to support disabling the XRay SDK entirely for NodeJS? Logging errors is rather a nuisance when it's not actually an error for our application that it cannot send traces, which we don't care about when a dev is doing local testing unrelated to XRay.
Still unresolved in 2021?
Hi @mannharleen
Apologies for the delay. We still have it on our backlog and would like to prioritize it as soon as possible. We will update this issue with any progress. Stay tuned. Thanks!
Most helpful comment
Hi @mannharleen
Apologies for the delay. We still have it on our backlog and would like to prioritize it as soon as possible. We will update this issue with any progress. Stay tuned. Thanks!