Install the agent using the following command:
Import thundra-lambda-agent-goimport "github.com/thundra-io/thundra-lambda-agent-go/v2/thundra" // with go modules enabled (GO111MODULE=on or outside GOPATH) for version >= v2.3.1import "github.com/thundra-io/thundra-lambda-agent-go/thundra" // with go modules disabled
Next, wrap your Lambda handler with thundra.wrap
:
Wrap your lambda handlerpackage main​import ("github.com/aws/aws-lambda-go/lambda"// thundra go agent import here)​// Your lambda handlerfunc handler() (string, error) {return "Hello, Thundra!", nil}​func main() {// Wrap your lambda handler with Thundralambda.Start(thundra.Wrap(handler))}
Build and deploy your executable to AWS as you usually do. In order to see your invocations in the Thundra web console, make sure that you have set the thundra_apiKey
environment variable to the API key you received from the Thundra web console. You can set the environment variables through the AWS Lambda console, in your serverless.yml
file, or using another method of your choice.
The API Key environment variablethundra_apiKey: your_api_key
Now you can invoke your Lambda function and see the details of your invocation in the Thundra console!