Skip to content

Latest commit

 

History

History
executable file
·
50 lines (32 loc) · 3.38 KB

monitoring-code-profiler.md

File metadata and controls

executable file
·
50 lines (32 loc) · 3.38 KB

Using CodeGuru Profiler with your Lambda function

You can use Amazon CodeGuru Profiler to gain insights into runtime performance of your Lambda functions. This page describes how to activate CodeGuru Profiler from the Lambda console.

Topics

Supported runtimes

You can activate CodeGuru Profiler from the Lambda console if your function's runtime is Python3.8, Python3.9, Java 8 with Amazon Linux 2, or Java 11. For additional runtime versions, you can activate CodeGuru Profiler manually.

Activating CodeGuru Profiler from the Lambda console

This section describes how to activate CodeGuru Profiler from the Lambda console.

To activate CodeGuru Profiler from the Lambda console

  1. Open the Functions page of the Lambda console.

  2. Choose your function.

  3. Choose the Configuration tab.

  4. On the Monitoring and operations tools pane, choose Edit.

  5. Under Amazon CodeGuru Profiler, turn on Code profiling.

  6. Choose Save.

After activation, CodeGuru automatically creates a profiler group with the name aws-lambda-<your-function-name>. You can change the name from the CodeGuru console.

What happens when you activate CodeGuru Profiler from the Lambda console?

When you activate CodeGuru Profiler from the console, Lambda automatically does the following on your behalf:

  • Lambda adds a CodeGuru Profiler layer to your function. For more details, see Use AWS Lambda layers in the Amazon CodeGuru Profiler User Guide.
  • Lambda also adds environment variables to your function. The exact value varies based on the runtime.
    Environment variables
    [See the AWS documentation website for more details]
  • Lambda adds the AmazonCodeGuruProfilerAgentAccess policy to your function's execution role.

Note
When you deactivate CodeGuru Profiler from the console, Lambda automatically removes the CodeGuru Profiler layer and environment variables from your function. However, Lambda does not remove the AmazonCodeGuruProfilerAgentAccess policy from your execution role.

What's next?

  • Learn more about the data collected by your profiler group in Working with visualizations in the Amazon CodeGuru Profiler User Guide.