Tracing Lambda functions can be declared in three methods:
- Auto-tracing through the Epsagon dashboard.
- Using the
serverless-plugin-epsagon
if you're using The Serverless Framework. - 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
});
Updated about a year ago