Thundra

Thundra: Serverless Observability for AWS Lambda

The black box nature of AWS Lambda and other serverless environments means that identifying and fixing performance issues is difficult and time-consuming. Built for straightforward debugging, monitoring, and observability, Thundra provides deep insight into your entire serverless environment. Thundra collects and correlates all your metrics, logs, and traces, allowing you to quickly identify problematic invocations and also analyzes external services associated with that function. With Thundra’s zero overhead and automated instrumentation capabilities, your developers are free to write code without worrying about bulking up their Lambdas or wasting time on chasing black box problems.

Get Started    Discussions

Trace Request/Response

Disable Request/Response Tracing for Lambda

Thundra’s Node.js agent Trace plug-in traces both request and response by default. You can disable either request or response tracing with simple configuration via declarative, programmatic API or environment variables.

Declarative Configuration(JSON Notation)

For declarative configuration of the Thundra Node.js agent Trace plugin, you need to define TraceConfig object in JSON notation by yourself. Below example disables tracing both request and response of Lambda Invocation.

const config = {
	apiKey:<Your API Key>,
	traceConfig : {
		disableRequest: true,
		disableResponse: true,
	},
};

const thundra = require("@thundra/core");

exports.handler = thundra(config)((event, context, callback) => {
    callback(null, {msg : 'hello world'});    
});

Programmatic Configuration

For programmatic configuration of the Thundra’s Node.js agent Trace plug-in, just create a TraceConfig object and configure the desired aspects. Below example configures trace definition such that all functions which start with set under business folder will be traced with arguments, return value and errors.

const thundra = require('@thundra/core');
const ThundraConfig = thundra.config.ThundraConfig;
const TraceConfig = thundra.config.TraceConfig;

const config = new ThundraConfig();
const traceConfig = new TraceConfig();
traceConfig.disableResponse = true;
traceConfig.disableRequest = true;

config.traceConfig = traceConfig;

exports.handler = thundra(config)((event, context, callback) => {
    callback(null, {msg : 'hello world'});    
});

Environment Variable

To disable tracing request of Lambda invocation set environment variable thundra_agent_lambda_trace_request_skip to true and to disable tracing response of Lambda Invocation thundra_agent_lambda_trace_response_skip to true.

Mask Request/Response Tracing for Lambda

Thundra’s Node.js agent Trace plug-in traces both request and response by default. You can mask either request or response tracing by providing a mask function with configuration via declarative or programmatic API.

Declarative Configuration(JSON Notation)

const config = {
	apiKey:<Your API Key>,
	traceConfig : {
		maskRequest:(request) => {
			if (request.password) {
				request.password = null;
			}
			return request;
		},
		maskResponse: (response) => {
			if (response.password) {
				response.password = null;
			}
			return response; 
		},
	},
}

const thundra = require("@thundra/core");

exports.handler = thundra(config)((event, context, callback) => {
    callback(null, {msg : 'hello world'});    
});

Programmatic Configuration

For programmatic configuration of the Thundra’s Node.js agent Trace plug-in, just create a TraceConfig object and configure the desired aspects. Below example masks passwordfield from tracing both request and response of Lambda Invocation.

const thundra = require('@thundra/core');
const ThundraConfig = thundra.config.ThundraConfig;
const TraceConfig = thundra.config.TraceConfig;

const config = new ThundraConfig();
const traceConfig = new TraceConfig();

traceConfig.maskRequest = (request) => {
    if (request.password) {
         request.password = null;
    }
    return request;
}

traceConfig.maskResponse = (response) => {
     if (response.password) {
         response.password = null;
     }
     return response; 
};

config.traceConfig = traceConfig;

exports.handler = thundra(config)((event, context, callback) => {
    callback(null, {msg : 'hello world'});    
});

Trace Request/Response


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.