debugging 如何在运行Lambda-local时禁用AWS X-Ray?

7tofc5zh  于 2023-03-30  发布在  其他
关注(0)|答案(1)|浏览(111)

https://github.com/ashiina/lambda-local
每次我用这个工具启动我的lambda时,我都会得到:

Error: Missing AWS Lambda trace data for X-Ray. Ensure Active Tracing is enabled and no subsegments are created outside the function handler.
    at Object.contextMissingLogError [as contextMissing] (/Users/justin.collum/Documents/work/foo/node_modules/aws-xray-sdk-core/dist/lib/context_utils.js:22:27)
    at Segment.resolveLambdaTraceData (/Users/justin.collum/Documents/work/fields-dp/node_modules/aws-xray-sdk-core/dist/lib/env/aws_lambda.js:86:49)
    at Object.getSegment (/Users/justin.collum/Documents/work/fields-dp/node_modules/aws-xray-sdk-core/dist/lib/context_utils.js:92:25)
    at Object.resolveSegment (/Users/justin.collum/Documents/work/fields-dp/node_modules/aws-xray-sdk-core/dist/lib/context_utils.js:71:25)
    at captureOutgoingHTTPs (/Users/justin.collum/Documents/work/fields-dp/node_modules/aws-xray-sdk-core/dist/lib/patchers/http_p.js:84:37)

这只是一个烦恼/视觉噪音,我认为它正在破坏pino-pretty。我认为在本地运行lambda时运行X-Ray没有任何价值。我尝试设置export AWS_XRAY_SDK_ENABLED=falseunset AWS_XRAY_SDK_ENABLED,都不起作用。AWS XRay代码来自内部库。

2w3kk1z5

2w3kk1z51#

export AWS_XRAY_CONTEXT_MISSING=IGNORE_ERROR照顾它。
https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-nodejs-configuration.html#xray-sdk-nodejs-configuration-envvars

相关问题