Using Epsagon with Stackery
Epsagon increases the observability of serverless stacks, giving you health information and deep tracing of poorly performing AWS Lambda functions. Epsagon also builds a useful cost estimation dashboard.
To add the Epsagon SDK to your stack, all you need to do is grab your Epsagon key from the 'Settings' menu.
Then in the Stackery settings go to Integrations and add your Epsagon token.
Your functions will be instrumented as soon as you next deploy them.
Instrumentation of functions is performed on all NodeJS and Python Lambdas automatically. Currently Lambdas in other languages won't be wrapped by Epsagon instrumentation, but Epsagon will still collect available usage metrics about these Lambdas as well.
The instrumentation wrapping happens at deploy time, and isn't part of your CloudFormation template configuration. As such, you won't see a separate code commit to your stack's template after you add the Epsagon key. Just deploy to see the instrumentation added.
Epsagon uses an AWS Lambda Layer to perform its instrumentation. This requires a small change relative to the official AWS Lambda runtimes for Node.js. Enabling the Epsagon integration switches Node.js functions to use Epsagon's publicly available runtime with an additional change to allow for instrumentation via Lambda Layers. For reference, the Epsagon Node.js runtimes are available in a public GitHub repo.
Should you want to remove Epsagon, just remove the key from the Integrations Menu in the Stackery dashboard, and click 'Save'.
Again, you won't see a change to your stacks' templates, but as soon as you deploy them again the instrumentation will be removed.