AWS Serverless Application Model (SAM) Epsagon Support

AWS Serverless Application Model (SAM)

Learn how to configure Epsagon's tracing library for the AWS Sam and enable automated tracing for your functions.

Installation

Configuring SAM Template YAML

In order to enable Epsagon with SAM, you need to configure the Handler to Epsagon's auto-tracing handler and additional environment variables mentioned below

Resources:
  ExampleFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: <epsagon-auto-tracing-handler>
      Runtime: nodejs10.x
      CodeUri: hello-world/
      Environment:
        Variables:
          EPSAGON_HANDLER: <your-handler>
          EPSAGON_TOKEN: <your-epsagon-token>
      Layers:
        - <epsagon-layer-arn - see below>

Epsagon's Auto-Tracing Handler

Replace the Handler with the following:

  • Python: epsagon.wrapper
  • Node.js: /opt/nodejs/node_modules/epsagon.wrapper

Epsagon's Layer ARN

Use the following endpoints to fetch the latest layer ARN based on language and region.

https://layers.epsagon.com/production?region=<region>&name=epsagon-<language>-layer&max_items=1

Epsagon's Node.js Layer in us-east-1
Epsagon's Python Layer in us-east-1

Epsagon's token

You can find your token in the Epsagon settings page.

Troubleshooting

Which programming language are supported with SAM?

Only Python & Node.js is support with the auto-tracing feature. If you're using a different language then the tracing library is your weapon of choice.

Can I use SAM local feature with Epsagon's auto-tracing configuration?

❗️

SAM local feature not supported

Local run with SAM is not supported with the auto-tracing configuration of SAM. We recommend to use the tracing library if running locally is part of your development flow

Getting Help

If you have any issue around using the library or the product, please don't hesitate to:

Opening Issues

If you encounter a bug with the Epsagon library, we want to hear about it.

When opening a new issue, please provide as much information about the environment:

  • Library version, runtime version, dependencies, etc.
  • Snippet of the usage.
  • A reproducible example can really help.

The GitHub issues are intended for bug reports and feature requests.
For help and questions about Epsagon, use the help widget inside the product.

License

Provided under the MIT license. See LICENSE for details.

Copyright 2020, Epsagon


Did this page help you?