Git Product home page Git Product logo

aws-lambda-apm-sample-app's Introduction

This is a sample Node.js application for AWS Lambda demonstrating the usage of Elastic APM.

Usage

To try the sample application you will need to install npm, Node.js and the Serverless framework.

Step 1 - Clone the sample application repo and install dependencies

git clone https://github.com/elastic/aws-lambda-apm-sample-app.git

cd aws-lambda-apm-sample-app/lambda-application
npm install --save-dev

cd ../load-generator
npm install --save-dev

Step 2 - Configure Elastic APM

To try out Elastic APM with AWS Lambda, you will need an Elastic Stack, including an APM Server that will receive the APM data. The simplest way to get started with Elastic APM is through Elastic Cloud. Sign up for a trial on Elastic Cloud through this link.

You need to provide the corresponding connection details to the APM Server in the env.json file. In addition, you can provide the AWS region to deploy the sample application to.

{
   "aws-region": "eu-central-1",
   "apm-server-url": "https://THIS_IS_YOUR_APM_SERVER_URL",
   "apm-server-token": "THIS_IS_YOUR_APM_SECRET_TOKEN"
}

Step 3 - Deploy the sample application

To deploy to AWS you will need an AWS access key with the following permissions:

  • AmazonS3FullAccess
  • CloudWatchLogsFullAccess
  • AmazonAPIGatewayAdministrator
  • AWSCloudFormationFullAccess
  • AWSLambda_FullAccess

Follow the instructions for setting up AWS credentials in AWS and using them with your system.

Once your AWS credentials are set up, execute the following command in the lambda-application directory to deploy the sample application:

serverless deploy

Copy the base URL of the API Gateway from the output in the console (r7ckl4adme.execute-api.eu-central-1.amazonaws.com in the following example):

…
endpoints:
  GET - https://r7ckl4adme.execute-api.eu-central-1.amazonaws.com/dev/ping
  POST - https://r7ckl4adme.execute-api.eu-central-1.amazonaws.com/dev/produce
…

Step 4 - Generate load

Change to the load-generator directory and execute the following command with the previously copied base URL of the API Gateway to start load generation.

sh ./load.sh <PASTE_THE_API_GATEWAY_BASE_URL_HERE> 

aws-lambda-apm-sample-app's People

Contributors

alexanderwert avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.