Skip to main content

Lambda Functions

The Epsagon agents allow you to collect and monitor your functions for metrics, traces, calls, and correlation to logs.

Auto-tracing for Node.js and Python functions#

Using the Epsagon dashboard you can easily enable tracing for Node.js and Python functions.

AWS Lambda Auto-Tracing#

This feature changes the functions' configuration by adding a layer and setting a new handler. We recommend getting started with a few functions in development. To enable auto-tracing, go to the functions screen, checkmark the desired functions on the left side, and under actions, click enable auto-tracing:

enable auto-tracing.png

To disable, follow the same instructions, but under actions select disable auto-tracing:

disable auto-tracing.png

Calling the SDK#

You can manually call the Epsagon SDK library inside your Lambda functions. Install our library according to your runtime:

npm install epsagon

Inside your function handler (where you get the event and context) add the following snippet, and wrap the handler:

const epsagon = require("epsagon");epsagon.init({  token: "<epsagon-token>",  appName: "<app-name-stage>",  metadataOnly: false,});
// Wrap your entry pointmodule.exports.handler = epsagon.lambdaWrapper((event, context, callback) => {  // Your code is here});
// Async functions supportedmodule.exports.handler = epsagon.lambdaWrapper(async (event) => {  // Your code is here});