Deployment Integrations
On-premise Integrations
Platform Integrations

Trace Configuration

Trace Configuration of Automatically Supported Integrations

Configuring AWS SDK Trace

As you use AWS Lambda functions to deploy serverless, the entire AWS SDK becomes complementary to your application architecture. That means it becomes necessary when developing and maintaining your application to monitor how your Lambda functions are interacting with external AWS SDK services such as DynamoDB, SQS, SNS, Kinesis, Firehose, S3, Lambda, Athena, etc. Thundra Java agent manages to integrate with the AWS SDK providing in-depth monitoring capabilities through the form of Trace spans. By default, this functionality is enabled, but can also be disabled as is required through configuration.

Masking SQS Messages

You can mask sent SQS message at client side which calls AWS SDK by setting following environment variable:

thundra_agent_trace_integrations_aws_sqs_message_mask: true

Masking SNS Messages

You can mask sent SNS message at client side which calls AWS SDK by setting following environment variable:

thundra_agent_trace_integrations_aws_sns_message_mask: true

Masking DynamoDB Statements

You can mask sent DynamoDB statements at client side which calls AWS SDK by setting following environment variable:

thundra_agent_trace_integrations_aws_dynamodb_statement_mask: true

Masking Lambda Payload

You can mask Lambda invocation payload at client side which calls AWS SDK by setting following environment variable:

thundra_agent_trace_integrations_aws_lambda_payload_mask: true

Masking API Gateway Request Body

You can mask request body at client side by setting following environment variable:

thundra_agent_trace_integrations_http_body_mask: true

Masking Athena Statements

You can mask Athena statements at client side which calls AWS SDK by setting following environment variable:

thundra_agent_trace_integrations_aws_athena_statement_mask: true

Unmasking Kinesis Records

By default Kinesis records at client side is not traced. You can enable tracing Kinesis records by setting following environment variable:

thundra_agent_trace_integrations_aws_kinesis_record_unmask: true

Unmasking Firehose Records

By default Firehose records at client side is not traced. You can enable tracing Firehose records by setting following environment variable:

thundra_agent_trace_integrations_aws_firehose_record_unmask: true

Disabling Sending AWS SDK Trace

By default, tracing AWS SDK calls is enabled, but can also be disabled as is required through configuration. You just need to set thundra_agent_trace_integration_aws_disable to true

Configuring Redis Trace

As fast access to data is a crucial attribute for several applications, you may find yourself using Redis clients such as Redisson with your Java Lambda functions in your application architectures. However, monitoring how your application interacts with Redis may is quite the task, especially when the concepts of clusters and nodes come into play. Hence Thundra's Java agent integrates with various Java Redis clients which to provide in-depth monitoring. Currently, the following Redis clients are supported:

  • Jedis

  • Lettuce

  • Redisson

Masking Redis

You can mask Redis calls by setting following environment variable:

thundra_agent_trace_integrations_redis_command_mask: true

Disabling Sending Redis Trace

By default, tracing Redis calls is enabled, but can also be disabled as is required through configuration. You can disable your integrations via Lambda environment variable. You just need to set thundra_agent_trace_integration_redis_disable to true.

Configuring HTTP Trace

Monitoring HTTP requests would is an important part of viewing how your system operates. Depending on how you implement your application, you would probably make several API calls, and hence being able to see how these the interaction with your API is executed would prove necessary. Thundra's Java agent integrates with HTTP to trace HTTP requests over HTTP clients. Currently, the following HTTP clients are supported:

  • Apache HTTP Client

Masking HTTP Request Body

You can mask http request body at client side by setting following environment variable:

thundra_agent_trace_integrations_http_body_mask: true

Disabling Sending HTTP Trace

Thundra traces HTTP calls by default. However, you may disable it using environment variables. You can set thundra_agent_trace_integrations_http_disableenvironment variable to true for this purpose.

Configuring JDBC Trace

Data storage is an integral part of any application, and hence monitoring how your Lamda functions perform regarding data storage is of paramount importance. Hence Thundra's Java agent traces query executions over JDBC java.sql.Statements and java.sql.PreparedStatement. Thundra is able to monitor JDBC responses for various database engines which include the following:

  • PostgreSQL

  • MySQL

  • MariaDB

  • Microsoft SQL Server

Masking JDBC Queries

You can mask JDBC queries at client side by setting following environment variable:

thundra_agent_trace_integrations_rdb_statement_mask: true

Disabling Sending JDBC Trace

By default, tracing JDBC queries is enabled, but can also be disabled as is required via thundra_agent_trace_integrations_rdb_disable environment variable to true

Configuring Elasticsearch Trace

Thundra Java agent integrates with various Java Elasticsearch clients which to provide in-depth monitoring. Currently, the following Elasticsearch clients are supported:

  • High level Rest client (6.x versions)

Masking Elasticsearch Body

You can mask Elasticsearch body at client side by setting following environment variable:

thundra_agent_trace_integrations_elasticsearch_body_mask: true

Disabling Sending Elasticsearch Trace

By default, tracing Elasticsearch responses is enabled, but can also be disabled as is required through configuration. You can disable your integrations via Lambda environment variable. You just need to set thundra_agent_trace_integrations_elasticsearch_disable to true

Configuring MongoDB Trace

Thundra Java agent integrates with various Java MongoDB clients which to provide in-depth monitoring. Currently, the following MongoDB clients are supported:

  • MongoDB Java Driver (3.1+ versions)

Masking MongoDB Commands

You can mask MongoDB commands at client side by setting following environment variable:

thundra_agent_trace_integrations_mongodb_command_mask: true

Disabling Sending MongoDB Trace

By default, tracing MongoDB operations is enabled, but can also be disabled as is required through configuration. You can disable your integrations via Lambda environment variable. You just need to set thundra_agent_trace_integrations_mongodb_disable to true

Configuring Trace Plugin

Disabling Request/Response Tracing for Lambda

By default, request and response are traced but can be disabled with environment variable configuration.

To disable tracing request set the thundra_agent_lambda_trace_request_skipenvironment variable to true

Configuration via Environment Variable
thundra_agent_lambda_trace_request_skip: true

To disable tracing response set the thundra_agent_lambda_trace_response_skipenvironment variable to true

Configuration via Environment Variable
thundra_agent_lambda_trace_response_skip: true

Unmasking Kinesis Records In Event

By default incoming Kinesis records at triggered Lambda is not traced. You can enable sending Kinesis records in request by setting following environment variable:

thundra_agent_lambda_trace_kinesis_request_enable: true

Unmasking Firehose Records In Event

By default incoming Firehose records at triggered lambda is not traced. You can enable sending Firehose records in request by setting following environment variable:

thundra_agent_lambda_trace_kinesis_request_enable: true

Unmasking CloudWatch Log Messages In Event

By default incoming CloudWatch logs at triggered lambda is not traced. You can enable sending CloudWatch logs in request by setting following environment variable:

thundra_agent_lambda_trace_cloudwatchlog_request_enable: true

Customize Request Masking

By request tracing customization support, you can specify which fields of the request should be traced or how the request should be traced.

For example, if you want to trace only id field of the UserGetRequest, you can customize request masking behavior of trace support by overriding the trace plugin as shown in the following example:

UserGetHandler
....
import com.amazonaws.services.lambda.runtime.Context;
import io.thundra.agent.lambda.core.handler.request.LambdaRequestHandler;
import io.thundra.agent.lambda.core.handler.LambdaHandlerConfig;
import io.thundra.agent.lambda.core.handler.plugin.LambdaHandlerPlugin;
import io.thundra.agent.lambda.trace.handler.plugin.TraceLambdaHandlerPlugin;
...
public class UserGetHandler
implements LambdaRequestHandler<UserGetRequest, UserGetResponse> {
...
@Override
public LambdaHandlerConfig<UserGetRequest, UserGetResponse> getConfig() {
return new LambdaHandlerConfig<UserGetRequest, UserGetResponse>() {
@Override
public List<LambdaHandlerPlugin<UserGetRequest, UserGetResponse>> getPlugins() {
return Arrays.asList(
new TraceLambdaHandlerPlugin<UserGetRequest, UserGetResponse>() {
...
@Override
protected Object maskRequest(UserGetRequest request) {
return new HashMap<String, Object>() {{
put("id", request.getId());
}};
}
...
});
}
};
}
...
}

Note: Same way is also supported over LambdaRequestStreamHandler.

Customize Response Masking

By response tracing customization support, you can specify which fields of the response should be traced or how the response should be traced.

For example, if you want to trace only id field of the User in the UserGetResponse, you can customize response masking behavior of trace support by overriding trace plugin as shown in the following example:

UserGetHandler
...
import io.thundra.agent.lambda.core.handler.request.LambdaRequestHandler;
import io.thundra.agent.lambda.core.handler.LambdaHandlerConfig;
import io.thundra.agent.lambda.core.handler.plugin.LambdaHandlerPlugin;
import io.thundra.agent.lambda.trace.handler.plugin.TraceLambdaHandlerPlugin;
...
public class UserGetHandler
implements LambdaRequestHandler<UserGetRequest, UserGetResponse> {
...
@Override
public LambdaHandlerConfig<UserGetRequest, UserGetResponse> getConfig() {
return new LambdaHandlerConfig<UserGetRequest, UserGetResponse>() {
@Override
public List<LambdaHandlerPlugin<UserGetRequest, UserGetResponse>> getPlugins() {
return Arrays.asList(
new TraceLambdaHandlerPlugin<UserGetRequest, UserGetResponse>() {
...
@Override
protected Object maskResponse(UserGetResponse response) {
return new HashMap<String, Object>() {{
put("id", response.getUser() != null ? response.getUser().getId() : null);
}};
}
...
});
}
};
}
...
}

Note: Same way is also supported over LambdaRequestStreamHandler.