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=false
和unset AWS_XRAY_SDK_ENABLED
,都不起作用。AWS XRay代码来自内部库。
1条答案
按热度按时间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