Thundra APM
Search…
Deployment Integrations
Integration Options for Go SDK
Programmatic Configuration

Step 1: Installation

Install the agent using the following command:
Import thundra-lambda-agent-go
1
import "github.com/thundra-io/thundra-lambda-agent-go/v2/thundra" // with go modules enabled (GO111MODULE=on or outside GOPATH) for version >= v2.3.1
2
import "github.com/thundra-io/thundra-lambda-agent-go/thundra" // with go modules disabled
Copied!

Step 2: Wrap Your Handler

Next, wrap your Lambda handler with thundra.wrap:
Wrap your lambda handler
1
package main
2
3
import (
4
"github.com/aws/aws-lambda-go/lambda"
5
// thundra go agent import here
6
)
7
8
// Your lambda handler
9
func handler() (string, error) {
10
return "Hello, Thundra!", nil
11
}
12
13
func main() {
14
// Wrap your lambda handler with Thundra
15
lambda.Start(thundra.Wrap(handler))
16
}
Copied!

Step 3: Build and Deploy

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 variable
1
thundra_apiKey: your_api_key
Copied!

Step 4: Invoke Your Function

Now you can invoke your Lambda function and see the details of your invocation in the Thundra console!

Last modified 11mo ago
Copy link
Contents