Skip to content

calvinx408/example-lambda-xray-py

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What's up?

Example Lambda Function running Python and X-ray using the https://github.com/racker/fleece/

Build dependencie package

  1. Run the following commands:
mkdir .vendor
pip install -r requirements.txt -t .vendor
serverless deploy
  1. Got to the AWS Lambda Console and enable active tracing for the function.

  2. Make sure your lambda function has permission to access GetUser in IAM and use X-Ray by creating a role with the following policy. If you use serverless framework to deploy, that step is not necessary since everything is set in the serverless.yml file

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "logs:CreateLogStream"
                "xray:PutTraceSegments",
                "xray:PutTelemetryRecords",
                "logs:PutLogEvents"
                "iam:Get*"
            ],
            "Resource": [
                "*"
            ],
            "Effect": "Allow"
        }
    ]
}
  1. Invoke your function and text X-Ray with Python
serverless invoke -f hello -l

About

Example Lambda Function running Python and X-ray using the https://github.com/racker/fleece/

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%