Announcing Profiling for your Java AWS Lambda Functions

Mx Kas Perch
IOpipe Blog
Published in
2 min readApr 4, 2018

--

So it’s been a bit since we released the IOpipe Java Agent, and we have some exciting news — profiling is here for Java! You can now view profiling info from your Java AWS Lambda functions in VisualVM.

The increased ease you can experience in deployment and operations with serverless comes with a bit of a catch: you lose a good bit of transparency, and it can be hard to get that visibility back! This is why profiling is so important — being able to see CPU profiling data of your Lambda functions over time and over iterations is a key ability to diagnose problems and identify solutions quickly.

Getting Started

In order to get started with Java Profiling, you’ll need to enable the plugin. To do so, in your serverless.yml file, in the environment variables section, add IOPIPE_PROFILING_ENABLED: true. Your serverless.yml section for your function will look something like this:

Example serverless.yml

After that, profiling data will begin showing up in the invocation view of the IOpipe dashboard (click the function name, scroll down to the invocation list, and click any invocation completed after profiling was turned on):

The profiling data download link in the IOpipe doshboard

Download the .zip file using the link, unzip it, then open up VisualVM and click ‘Load Snapshot’. Then set the dropdown for file type to ‘profile snapshots’ and select the unzipped .nps file and voila! Tracing data for your AWS Lambda Java function!

Profiling Data in VisualVM

You can read even more about how to set profiling up in your Java AWS Lambda functions in our documentation. We’d also love to hear what you think in our community slack, or on Twitter!

If you’re using AWS Lambda Functions and want to try out profiling your Java AWS Lambda functions with IOpipe, we’ve got a 2-week full-access trial and a forever-free tier. Give it a shot!

--

--

Dev🥑. Robotics Author and Maker. Yells at robots occasionally.