Deployment Integrations
On-premise Integrations
Platform Integrations

Online Debugging

Using the Online Debugging with Python Lambda Functions

  1. Integrate Thundra Python agent with your Lambda function using one of the available integration options.

  2. Add ptvsd layer below changing ${region} parameter

    arn:aws:lambda:${region}:269863060030:layer:thundra-lambda-python-ptvsd-layer:1

  3. Enable the online debugging using by adding the thundra_agent_lambda_debugger_auth_token environment variable and thundra_agent_lambda_debugger_enable to true

  4. Specify a session name if needed (as long as you don't have multiple concurrent debug sessions you don't have to specify a session name, default value just works fine)

  5. Configure Thundra Debugger in your IDE (VSCode and Other)

  6. Start the debug session in your IDE and invoke your function, Thundra Debugger will establish the connection between the IDE and your lambda function using your authentication token and the session name.

  7. You can disable the Online Debugging once you completed your debugging session.

Make sure to increase your function's timeout value when you enable the online debugging for longer debug sessions.

To use online debugging feature, you need to use Thundra Python agent version 2.4.5 and layer version 20 or higher.

Enabling the Online Debugging

Fastest way of enabling Thundra debugger for a lambda function is setting the thundra_agent_lambda_debugger_auth_token environment variable to the authentication token that you can get from the Thundra console and setting thundra_agent_lambda_debugger_enable to true. This way, Thundra will start your function in debug mode. You will be able to connect your function from your IDE to start the debugging session.

Disabling the Online Debugging

Online Debugging feature is disabled by default. However if you want to disable it explicitly, you can set thundra_agent_lambda_debugger_enable environment variable to the false . In that case even if you have thundra_agent_lambda_debugger_auth_token , online debugging will be still disabled.

Specifying a session name

In order to match the two end of an online debugging session which are your lambda function invocation and your local IDE, Thundra uses session names. When you enable the online debugging in your lambda function session name is set to the predefined value "default". If you want to use another session name you can specify it using the thundra_agent_lambda_debugger_session_name environment variable.

Broker Host Selection

Thundra broker establishes communication between your Lambda function and your IDE debugger. It receives data from Lambda function and forward to your IDE. To reduce overhead during this transmission process, you need to select a broker host that provides shortest path for your Lambda and IDE. Broker host need to be close to Lambda or your IDE location.

Thundra provide a broker host on Oregon by default. Moreover, we support different broker hosts listed below. You can select and set to thundra_agent_lambda_debugger_broker_hostenvironment variable to reduce latency during debugging session.

Concurrent Session Limit

Number of debug sessions for an account is limited for now. You can start 2 concurrent debug session at a time. You can contact us from support@thundra.io or intercom bubble on the right bottom corner of Thundra console if you want to increase your concurrent session limits.

Environment variables to configure Online Debugging

Environment Variable

Description

thundra_agent_lambda_debugger_auth_token

The authentication token you get from the Thundra console. This field is required and there is no default value.

thundra_agent_lambda_debugger_session_name

The unique session name to identify current debug session among the other concurrent debug sessions. The default value is "default".

thundra_agent_lambda_debugger_broker_host

The broker host address that Thundra connects to start a debug session with your IDE. The default value is "debug.thundra.io"

thundra_agent_lambda_debugger_broker_port

The broker port that Thundra uses to connect the broker. The default value is 444.

thundra_agent_lambda_debugger_wait_max

The maximum amount of time in milliseconds that your function should wait until a debug session request is coming from the IDE. The default value is 60000.

thundra_agent_lambda_debugger_logs_enable

Boolean value to enable Thundra debugger logs. The default value is false.

thundra_agent_lambda_debugger_enable

Boolean value to enable/disable to Thundra debugger. It can be set to the true to enable the debugger (authentication token environment variable should also be set), and setting it to the false disables the Thundra debugger.