AWS Lambda

Tracing Lambda functions can be declared in three methods:

  1. Auto-tracing through the Epsagon dashboard.
  2. Using the serverless-plugin-epsagon if you're using The Serverless Framework.
  3. Calling the SDK.

📘

Choosing one method

Make sure to choose just one of the methods

Calling the SDK is simple:

const epsagon = require('epsagon');
epsagon.init({
  token: 'epsagon-token',
  appName: 'app-name-stage',
  metadataOnly: false,
});

// Wrap your entry point
module.exports.handler = epsagon.lambdaWrapper((event, context, callback) => {
  // Your code is here
});

// Async functions example
module.exports.handler = epsagon.lambdaWrapper(async (event) => {
  // Your code is here
});

Did this page help you?