Deployment Integrations
On-premise Integrations
Platform Integrations

Others

Thundra Debug Client

Thundra provides plugins for VSCode(Nodejs, Python) and Intellij Idea (Java). Thundra Debug Client can be used for other development environments supporting remote debugging to act as a proxy between the local environment and Thundra Debug Broker.

Below you can find how to use Thundra client to debug your Lambda functions on other IDEs. Check our examples after installation for Eclipse and WebStorm to understand how to use Thundra Debugger Client.

Installation of Thundra Debug Client

To install it globally run:

$ sudo pip install thundra-debug-client

or to install for current user:

$ pip install --user

Synopsis

thundradebug [--help] [-h HOST] [-p PORT] [-a AUTH] [-f FILE]
[-r PROFILE] [-v] [-sp KEY=VALUE [KEY=VALUE ...]]

Description

Options

Description

-h, --host

Debug broker host

-p, --port

Debug broker port

-a, --auth

Authentication token

-f, --file

Configuration file path

-r, --profile

Configuration profile name

-sp

KEY=VALUE [KEY=VALUE ...] Session port mappings in -sp <port>=<session-name> format

example: -sp 12358=default

For each session name a different port number should be provided.

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.

Configuration File Format

Configuration parameters to thundra debug cli can be provided by either configuration files or cli arguments. Default configuration is stored under .thundra/debug-client.json under user home directory. Another configuration file path can be given to cli by -f or --file arguments. Configuration file format is as follows:

{
"profiles": {
"default": {
"debugger": {
"authToken": <set-your-thundra-auth-token>,
"sessionName": "default",
"brokerHost": "debug.thundra.io",
"brokerPort": 443,
"sessions" : {
"default" : 12358
}
}
}
}
}

Eclipse

  • Select Remote Java Application and add a new configuration.

  • Select Project and enter a port number on which thundra debug client will listen. Then click Apply.

The port number configured in here should also be given when starting the thundra debug client as either command line argument or in the configuration file. For example, if you want to map session name lab to port 1111 client should be started as:

thundradebug -sp 1111=lab

  • Start thundra debug client provided with required parameters (auth token and port to session name mapping if not using default mapping 12358=default) .

Example:

$ thundradebug --auth <your-auth-token> -sp 1111=lab 12358=default
  • Click Debug on the configuration tab.

  • Set a debug point on your AWS Lambda function.

  • Now invoke your AWS Lambda function to hit on the debug point.

  • Debug session ends when your AWS Lambda function times out. You can update the timeout of your function for longer debug sessions.

WebStorm

  • Select Run - Edit Configurations on WebStorm.

  • Add new configuration Attach to Nodejs/Chrome.

  • Enter a port number on which thundra debug client will listen. Then click OK.

  • Select Chrome or Node.js > 6.3 started with --inspect for attach to configuration.

The port number configured in here should also be given when starting the thundra debug client as either command line argument or in the configuration file. For example, if you want to map session name lab to port 1111 client should be started as:

thundradebug -sp 1111=lab

  • Start thundra debug client provided with required parameters (auth token and port to session name mapping if not using default mapping 12358=default) .

Example:

$ thundradebug --auth <your-auth-token> -sp 1111=lab 12358=default
  • Set a debug point on your AWS Lambda function.

  • Select the run profile created for thundra from the Run Configurations dropdown.

  • Click on the Debug button to start debug session with selected profile.

  • Now invoke your AWS Lambda function to hit on the debug point.

  • Debug session ends when your AWS Lambda function times out. You can update the timeout of your function for longer debug sessions.