Skip to content

Instantly share code, notes, and snippets.

@mdlavin
Created June 10, 2018 22:41
Show Gist options
  • Save mdlavin/ff4f2feeebc9e8de64963bb610cf819c to your computer and use it in GitHub Desktop.
Save mdlavin/ff4f2feeebc9e8de64963bb610cf819c to your computer and use it in GitHub Desktop.
Node.js AWS X-Ray instrumentation
const xray = require('aws-xray-sdk-core');
// Allow X-Ray to track execution through API API calls
xray.captureAWS(require('aws-sdk'));
// Allow X-Ray to track execution through external API calls
xray.captureHTTPsGlobal(require('http'));
// Allow X-Ray to track execution when Promises are used
xray.capturePromise();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment