Deployment Integrations
On-premise Integrations
Platform Integrations

Tagging

With Thundra's Node.js agent, you can add custom tags to your invocations or your applications, which will help you better filter the data. Invocation tags are added only to the Invocation data type; application tags are global and are automatically added to Invocation, Metric, Trace, Span, and Log data.‌

Adding Invocation Tags

You can add custom tags to your invocation with methods in the InvocationSupport module. The functions that can be used in the module are shown below:

static setTag(key: string, value: any): void
static getTag(key: string): any
static removeTag(key: string): void
static setTags(keyValuePairs: {[key: string]: any }): void
static removeTags(): void
static setError(exception: any): void

The example below shows how to tag a Lambda invocation(e.g., Lambda Handler):

Setting an invocation tag
const thundra = require("@thundra/core");
exports.handler = thundra()((event, context,callback) => {
thundra.InvocationSupport.setTag('userName', 'foo');
callback(null, 'Hello Thundra!');
});

Adding Application Tags

You can add application tags via environment variables. All application tags which start with thundra_agent_lambda_application_tag_ are parsed by Thundra's Node.js agent. The text after the thundra_agent_lambda_application_tag_ prefix is used as the key of the tag, and the value of the environment variable becomes the value of the tag. For example, thundra_agent_lambda_application_tag_floatField with the value 12.123 will add an application tag to all data with the key floatField and the value 12.123.‌

The example below shows how to add application tags with various data types to a Lambda invocation:

Setting application tags through the Lambda console