A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.aws.amazon.com/codeguru/latest/profiler-ug/python-lambda-layers.html below:

Use AWS Lambda layers - Amazon CodeGuru Profiler

Use AWS Lambda layers

There are two ways you can use layers to enable CodeGuru in Lambda functions using Python. The preferred method uses a wrapper script and only works for applications that run on Python 3.8 or 3.9. The second method works for Python 3.7, and can also be used for Python 3.8 and 3.9 if you already have a lambda wrapper or if the preferred method otherwise does not work.

For applications that run on Python 3.8 or 3.9 (preferred)
  1. Add the CodeGuru Profiler layer to Lambda. Choose Specify an ARN and add arn:aws:lambda:region:157417159150:layer:AWSCodeGuruProfilerPythonAgentLambdaLayer:11. For more information on adding a Lambda layer, see AWS Lambda layers.

  2. Add the following environment variable: AWS_LAMBDA_EXEC_WRAPPER=/opt/codeguru_profiler_lambda_exec

  3. Add an environment variable with your profiling group name or ARN. For information on using your ARN, see the table listed in Apply the CodeGuru Profiler function decorator to your handler function.

Note

You can only have one Lambda wrapper script. If you are currently using one, try the solution for applications that run on Python 3.7, 3.8 or 3.9.

For applications that run on Python 3.7, 3.8 or 3.9
  1. Add the CodeGuru Profiler layer to Lambda. Choose Specify an ARN and arn:aws:lambda:region:157417159150:layer:AWSCodeGuruProfilerPythonAgentLambdaLayer:11. For more information on adding a Lambda layer, see AWS Lambda layers.

  2. Set the environment variable, HANDLER_ENV_NAME_FOR_CODEGURU to your handler function.

  3. Change the Lambda handler function to codeguru_profiler_agent.aws_lambda.lambda_handler.call_handler.

  4. Add an environment variable with your profiling group name or ARN. For information on using your ARN, see the table listed in Apply the CodeGuru Profiler function decorator to your handler function.

Apply the CodeGuru Profiler function decorator to your handler function

Enabling the agent with code

Did this page help you? - Yes

Thanks for letting us know we're doing a good job!

If you've got a moment, please tell us what we did right so we can do more of it.

Did this page help you? - No

Thanks for letting us know this page needs work. We're sorry we let you down.

If you've got a moment, please tell us how we can make the documentation better.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4