title: AWS X-Ray Trace ID Root not set when invoking Lambda from another Lambda function in Node.js
body: <p>I have <code>X-Ray</code> cofnigured and it works for most of the system but having issue when invoking a <code>Lambda</code> from another <code>Lambda</code>. I am wrapping whole <code>aws</code> SDK before calling <code>new Lambda()</code>:</p>
  <pre><code>import xray from 'aws-xray-sdk-core';
  import aws from 'aws-sdk';
  
  const awsXray = xray.captureAWS(aws);
  const lambda = new awsXray.Lambda();
  const response = await lambda.invoke({...}).promise();
  </code></pre>
  <p>Similar approach works for other services but with this invocation, the <code>Lambda</code> that is being invoked has always <code>Trace ID</code> root set to <code>Root=1-00000000-000000000000000000000000</code></p>
  <p>I have tried also wrapping an instance as:
  <code>const lambda = captureAWSClient(new aws.Lambda());</code> but this did not help. The lambda that is invoking (code above) has <code>Trace ID</code> correctly set.</p>