This page describes how to use the Python Serverless Tracer with AWS Lambda functions.
Before You Begin
Ensure that your setup meets the following requirements:
- Existing AWS Lambda functions implemented in Python version 3.6 or later
- Python Package Installer (
pipversion must match the Python version of your AWS Lambda function)
- AppDynamics SaaS Controller version 4.5.16 or later
Install the Python Serverless Tracer
The Python Serverless Tracer is available for Python version 3.6 and later. The version of the tracer you obtain from PyPi needs to match the version of Python you use to run your function code in AWS.
The Python Serverless Tracer is available for download in PyPi repository. You can install the Python Serverless Tracer locally or package it with your AWS Lambda function code.
pip install command to install the tracer in your local environment:
If you install the tracer locally, you need to package the tracer with your AWS Lambda function at runtime.
Package with AWS Lambda Functions
Run the following command to include the tracer in your function's package:
See AWS documentation to learn more about packaging dependencies in your functions.
Instrument Your Function Code
To instrument your AWS Lambda function, add the following lines of code:
Exit Call Instrumentation
By default, the Python Serverless Tracer automatically discovers HTTP, Amazon DynamoDB, and inter-AWS Lambda exit calls. Use the Python Tracer API to create an exit call if you want visibility into other types of external calls made by your function. See Python Serverless Tracer API.
This document contains links to AWS documentation. AppDynamics makes no representation as to the accuracy of Amazon documentation because Amazon controls its own documentation
Amazon Web Services, the AWS logo, AWS, and any other AWS Marks used in these materials are trademarks of Amazon.com, Inc. or its affiliates in the United States and/or other countries.