You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

datadog-lambda-js

Package Overview
Dependencies
Maintainers
1
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datadog-lambda-js

Lambda client library that supports hybrid tracing in node js

10.124.0
latest
npm
Version published
Weekly downloads
635K
-10.18%
Maintainers
1
Weekly downloads
 
Created

What is datadog-lambda-js?

The datadog-lambda-js npm package is designed to help you monitor and trace your AWS Lambda functions with Datadog. It provides tools to automatically collect and send metrics, logs, and traces from your Lambda functions to Datadog, enabling you to gain insights into the performance and behavior of your serverless applications.

What are datadog-lambda-js's main functionalities?

Automatic Tracing

This feature allows you to automatically trace your Lambda function executions. By wrapping your handler with the `datadog` function, you can send traces to Datadog without manually instrumenting your code.

const { datadog } = require('datadog-lambda-js');

const handler = datadog(async (event, context) => {
  // Your Lambda function code here
  return { statusCode: 200, body: 'Hello, world!' };
});

module.exports.handler = handler;

Custom Metrics

This feature allows you to send custom metrics from your Lambda functions to Datadog. You can use the `sendDistributionMetric` function to send metrics with specific values and tags.

const { sendDistributionMetric } = require('datadog-lambda-js');

const handler = async (event, context) => {
  // Your Lambda function code here
  sendDistributionMetric('my_custom_metric', 42, 'tag:value');
  return { statusCode: 200, body: 'Hello, world!' };
};

module.exports.handler = handler;

Log Forwarding

This feature enables you to forward logs from your Lambda functions to Datadog. By wrapping your handler with the `datadog` function, logs generated within your Lambda function will be automatically sent to Datadog.

const { datadog } = require('datadog-lambda-js');

const handler = datadog(async (event, context) => {
  console.log('This is a log message');
  return { statusCode: 200, body: 'Hello, world!' };
});

module.exports.handler = handler;

Other packages similar to datadog-lambda-js

FAQs

Package last updated on 31 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts