Thundra APM
Search…
Deployment Integrations
Powered By GitBook
Configuring Traces for Go SDK

Configuring the Trace Plugin

You can configure the trace plugin using the following environment variables.
Set the variable below to true if you want to disable the trace plugin; the trace plugin is enabled by default.
Configuration of Trace Plugin
1
thundra_agent_lambda_trace_disable
Copied!
Set the variable below to true if you want to disable monitoring of Lambda requests.
Configuration of Trace Request
1
thundra_agent_lambda_trace_request_skip
Copied!
Set the variable below to true if you want to disable monitoring Lambda responses.
Configuration of Trace Response
1
thundra_agent_lambda_trace_response_skip
Copied!

Configuring AWS SDK Trace

Thundra's Go agent provides you with the capability to trace AWS SDK by wrapping the session object that AWS SDK provides. You can easily start using it by simply wrapping your session objects as shown in the following code:
Go
1
package main
2
3
import (
4
"github.com/aws/aws-lambda-go/lambda"
5
"github.com/aws/aws-sdk-go/aws"
6
"github.com/aws/aws-sdk-go/aws/session"
7
"github.com/aws/aws-sdk-go/service/dynamodb"
8
"github.com/thundra-io/thundra-lambda-agent-go/thundra"
9
thundraaws "github.com/thundra-io/thundra-lambda-agent-go/wrappers/aws"
10
)
11
12
// Your lambda handler
13
func handler() (string, error) {
14
// Create a new session object
15
sess, _ := session.NewSession(&aws.Config{
16
Region: aws.String("us-west-2")},
17
)
18
19
// Wrap it using the thundraaws.Wrap method
20
sess = thundraaws.Wrap(sess)
21
22
// Create a new client using the wrapped session
23
svc := dynamodb.New(sess)
24
25
// Use the client as normal, Thundra will automatically
26
// create spans for the AWS SDK calls
27
svc.PutItem(&dynamodb.PutItemInput{
28
Item: map[string]*dynamodb.AttributeValue{
29
"AlbumTitle": {
30
S: aws.String("Somewhat Famous"),
31
},
32
"Artist": {
33
S: aws.String("No One You Know"),
34
},
35
"SongTitle": {
36
S: aws.String("Call Me Today"),
37
},
38
},
39
ReturnConsumedCapacity: aws.String("TOTAL"),
40
TableName: aws.String("Music"),
41
})
42
43
return "Hello, Thundra!", nil
44
}
45
46
func main() {
47
// Wrap your lambda handler with Thundra
48
lambda.Start(thundra.Wrap(handler))
49
}
Copied!
After you have wrapped the session object, everything else will be handled automatically. The spans representing AWS SDK calls will be shown in your trace chart.

Disabling AWS Integrations

Tracing AWS SDK responses is enabled by default, but this can also be disabled if needed through configuration. You just need to set the following environment variable to true:
Configuration of Disabling Aws Integrations
1
thundra_agent_lambda_trace_integrations_aws_disable
Copied!

Masking SQS Messages

You can mask SQS messages sent on the client’s side, which calls AWS SDK. You just need to set the following environment variable to true:
Masking SQS Messages
1
thundra_agent_lambda_trace_integrations_aws_sqs_message_mask
Copied!

Masking SNS Messages

You can mask SNS messages sent on the client’s side, which calls AWS SDK. You just need to set the following environment variable to true:
Masking SNS Messages
1
thundra_agent_lambda_trace_integrations_aws_sns_message_mask
Copied!

Masking Lambda Payload

You can mask Lambda invocation payload on the client’s side, which calls AWS SDK. You just need to set the following environment variable to true.
Masking Lambda Payload
1
thundra_agent_lambda_trace_integrations_aws_lambda_payload_mask
Copied!

Masking HTTP Body

You can mask an HTTP body on the client’s side, which calls AWS SDK. You just need to set the following environment variable to true:
Masking HTTP Body
1
thundra_agent_lambda_trace_integrations_aws_http_body_mask
Copied!
Last modified 9mo ago