Skip to main content

Serverless Debugger Python

Project description

serverlessdebugger-agent-python

Pyversions PyPI

Debug your marvelous python lambda with serverless debugger by Thundra!

Contents

Installation

  • Login from our website

  • Get your authentication key.

  • Install our Debugger for AWS Lambda.

  • Write "Serverless Debugger" to Command Palette on VSCode and click "Edit Configuration" and paste your authentication key to authToken. Command Palette

  • Set SLSDEBUGGER_AUTH_TOKEN also by your authentication token to your lambda environment.

  • Follow one of the following two steps.

Using Serverless Debugger Lambda Layer

  • Add Serverless Debugger lambda layer!
arn:aws:lambda:${region}:545538059309:layer:slsdebugger-python:${latest-version} 
  • Latest version of the Serverless Debugger Python Layer Serverless Debugger Python Layer

  • Supported regions: ap-northeast-1, ap-northeast-2, ap-south-1, ap-southeast-1, ap-southeast-2, ap-east-1, ca-central-1, eu-central-1, eu-north-1, eu-south-1, eu-west-1, eu-west-2, eu-west-3, sa-east-1, us-east-1, us-east-2, us-west-1, us-west-2

  • Set SLSDEBUGGER_AUTH_TOKEN in environment variable.

  • Set SLSDEBUGGER_LAMBDA_HANDLER to your lambda handler in environment variable.

  • Open your handler file in VSCODE, put breakpoint and start Serverless Debugger extension downloaded from Debugger for AWS Lambda.

  • Trigger your lambda function.

Manually Wrapping

  • Run this command from your project directory:
pip install slsdebugger -t .
  • Wrap your lambda function.
import slsdebugger

@slsdebugger.lambda_wrapper
def handler(event, context):
    print("Hello Serverless Debugger!")
  • Set SLSDEBUGGER_AUTH_TOKEN in environment variable.

  • Open your handler file in VSCODE, put breakpoint and start Serverless Debugger extension downloaded from Debugger for AWS Lambda.

  • Trigger your lambda function.

Configuration

You can configure Serverless Debugger using environment variables.

Check out the configuration part of our docs for more detailed information.

1. Environment variables

  • Only required environment variable is SLSDEBUGGER_AUTH_TOKEN. If it is empty, Serverless Debugger only calls your function without debugging.
Name Type Default Value
SLSDEBUGGER_ENABLED bool true
SLSDEBUGGER_AUTH_TOKEN string -
SLSDEBUGGER_PORT int 1111
SLSDEBUGGER_LOGS_ENABLE bool false
SLSDEBUGGER_WAIT_MAX int 60000(ms)
SLSDEBUGGER_IO_WAIT int 2000(ms)
SLSDEBUGGER_BROKER_PORT bool 444
SLSDEBUGGER_BROKER_HOST bool broker.service.serverlessdebugger.com
SLSDEBUGGER_SESSION_NAME string default
SLSDEBUGGER_LAMBDA_HANDLER string -
SLSDEBUGGER_LAMBDA_WARMUP_WARMUPAWARE bool false
SLSDEBUGGER_LAMBDA_TIMEOUT_MARGIN int -

Getting Help

If you have any issue around using the library or the product, please don't hesitate to:

  • Use the documentation.
  • Open an issue in GitHub.
  • Join our python slack channel.

Opening Issues

For any problem you encounter while using Serverless Debugger Python, Please feel free to contact us via github issue or our python slack channel.

When opening a new issue, please provide as much information about the environment:

  • Library version, Python runtime version, dependencies, operation system with version etc.
  • Snippet of the usage.
  • A reproducible example can really help.

The GitHub issues are intended for bug reports and feature requests.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slsdebugger-0.0.8.tar.gz (13.0 kB view hashes)

Uploaded Source

Built Distribution

slsdebugger-0.0.8-py3-none-any.whl (14.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page