Epsagon now supports AWS Lambda Extensions. Lambda Extensions enable users to integrate complex tools without complex installation. This greatly simplifies the integration of Epsagon in Lambda environments, thus reducing operational overheads. 

Using Epsagon’s Layers for Lambda Functions

Our layers are publicly available for Python and Node.js Lambda runtimes. With just a few Environment Variables, the layer will automatically add tracing to your functions.

cURL https://layers.epsagon.com/production with the following query parameters to fetch the latest layer ARN:

  • region=REGION    #Choices for REGION include all AWS regions.
  • name=epsagon-LANGUAGE-layer      #Choices for LANGUAGE include python and node.
  • max_items=1

For example, to get the latest layer for Node.js in us-east-1, the endpoint would become:

https://layers.epsagon.com/production?region=us-east-1&name=epsagon-node-layer&max_items=1

Node.js

fetch('https://layers.epsagon.com/production?region=us-east-1&name=epsagon-node-layer&max_items=1')
    .then(r => r.json())
    .then(r => r.LayerVersions[0].LayerVersionArn)

Python

import requests

r = requests.get('https://layers.epsagon.com/production?region=us-east-1&name=epsagon-node-layer&max_items=1')

arn = r.json()['LayerVersions'][0]['LayerVersionArn']

The ARN has a format of

arn:aws:lambda:REGION:ACCOUNT:layer:epsagon-LANGUAGE-layer:VERSION

Add this layer to your function, and finalize tracing with environment variables.

 

Environment Variables

Configure Environment Vars for auto-tracing

Python 

export EPSAGON_TOKEN=<EPSAGON-TOKEN>

export EPSAGON_APP_NAME=<APP-NAME-STAGE>

export AUTOWRAPT_BOOTSTRAP=epsagon   # copy exact

Node.js

export EPSAGON_TOKEN=<EPSAGON-TOKEN>

export EPSAGON_APP_NAME=<APP-NAME-STAGE>

export NODE_OPTIONS='-r epsagon-frameworks'   # copy exact

 

Conclusion

With the support for AWS Lambda Extensions, developers can improve their development efficiency by focussing on what is important for them – coding and deploying their code – without spending too much time worrying about operational overheads.

Learn more on how Epsagon can help with development efficiency. You can also signup for a demo here.