Skip to content

Latest commit

 

History

History

lambda-layer

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

AWS Distro Lambda Layer for NodeJS

This package includes the following three components

  1. AWS Lambda Layer implementation for supporting Application Signals in AWS Lambda.
  2. Lambda Sample App with AWS SDK to demonstrate Application Signals telemetry data generated by Lambda Layer.
  3. Terraform script for deploy the sample app with Lambda layer built from the local package.

Scripts to build everything

Run the following command in the root director to build both NodeJS Lambda Layer and Sample App.

Note: Make sure to install NodeJS 16+ to build the layer. Lower version of NodJS runtime is not supported by AWS Lambda anymore.

  1. ./lambda-layer/build.sh

Steps to Build AWS Lambda Layer

  1. Run the following command in the root director

    • ./scripts/build_and_install_distro.sh
  2. Run to the following steps in ${root}/lambda-layer/packages/layer director

    npm install
    npm run compile
    

Steps to Deploy this Lambda function

Go to ${root}/lambda-layer/sample-apps/aws-sdk director,

  1. run npm install.
  2. run terraform init and terraform apply.

The lambda function(aws-opentelemetry-distro-nodejs) will be initialized and the URL for an API Gateway invoking the Lambda will be displayed at the end. Send a request to the URL in a browser or using curl to execute the function. Then, navigate to Lambda function's Monitoring page. You will see a log stream with an event time and Traces data corresponding to when you issued the request, open it and you can find information about the exported spans in the log stream.