Skip to content

Demo/talk showing how you can integrate and use JavaFlightRecorder from within an AWS Lambda

Notifications You must be signed in to change notification settings

steven-aerts/lambda-jfr-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serverless JFR

Recording the flight of Serverless Functions
Devoxx talk 2022/10/10

Hello and welcome. I really like that you are showing interest in the aditional content of the Devoxx talk I preformed on 2022/10/10.

This repository contains the slides and all code samples. A recording will later be made available by Devoxx.

The different code samples can be found under the different tags in git.

  • git checkout tag0: baseline, a basic lambda we will work with
  • git checkout tag1: enables JFR
  • git checkout tag2: do more in the beginning of lambda
  • git checkout tag3: extra optimization tricks (CRT http implementation, hard code was region and cred provider)
  • git checkout tag4: enable JFR without code changes with lambda layer without

To deploy the code in your own environment:

cd lambda
../gradlew assemble && sam build && sam deploy

After deployment, sam will show you a url from the format https://<id>.lambda-url.<region>.on.aws/ everyone can trigger your lambda:

curl https://<id>.lambda-url.<region>.on.aws/

There are also 2 helper scripts:

# call lambda 10 times and summarize its duration
./loadTest.sh https://<id>.lambda-url.<region>.on.aws/
# call lambda with ?jfr trigger to dump jfr's and sync them to /tmp/jfr-dumps
./getJfr.sh https://<id>.lambda-url.<region>.on.aws/

Enjoy!

Any feedback is welcome.
Do not feel shy to ask your questions in the form of an issue on this repo or even a PR.

About

Demo/talk showing how you can integrate and use JavaFlightRecorder from within an AWS Lambda

Resources

Stars

Watchers

Forks

Packages

No packages published