Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
datadog-lambda-js
Advanced tools
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.
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;
The aws-xray-sdk package is an AWS service that provides tracing capabilities for AWS Lambda functions. It allows you to trace requests as they travel through your entire application, including Lambda functions, and visualize the trace data in the AWS X-Ray console. While it offers tracing similar to datadog-lambda-js, it is specific to the AWS ecosystem and does not provide the same level of integration with Datadog.
The serverless-plugin-datadog package is a Serverless Framework plugin that automatically instruments your Lambda functions with Datadog. It provides similar functionality to datadog-lambda-js but is designed to work within the Serverless Framework, making it easier to integrate Datadog monitoring into your serverless applications.
Datadog Lambda Library for Node.js (14.x, 16.x, and 18.x) enables enhanced Lambda metrics, distributed tracing, and custom metric submission from AWS Lambda functions.
Follow the installation instructions, and view your function's enhanced metrics, traces and logs in Datadog.
Follow the configuration instructions to tag your telemetry, capture request/response payloads, filter or scrub sensitive information from logs or traces, and more.
For additional tracing configuration options, check out the official documentation for Datadog trace client.
Datadog's Continuous Profiler is now available in beta for NodeJS in version 6.87.0 and layer version 87 and above. This optional feature is enabled by setting the DD_PROFILING_ENABLED
environment variable to true
. During the beta period, profiling is available at no additional cost.
The 5.x.x release introduces version 2 of the Datadog tracer, dd-trace-js. This includes a few breaking changes, and the migration guide found here.
The first 5.x.x version was released with Lambda Layer version 69
.
The 6.x.x release introduces support for the node 16 runtime and esm modules.
The 7.x.x release drops support for Node12, and upgrades dd-trace-js to version 3.x
There is a full migration guide available here. Some changes are more likely to impact Serverless users:
HTTP Operation Name Changed
. HTTP requests will no longer appear as a separate client under *-http-client
, which polluted the APM service catalog.tracer.currentSpan()
has been deprecated for a long time, and is now removed.tracer.bindEmitter()
is similarly removed after being deprecated.If you encounter a bug with this package, we want to hear about it. Before opening a new issue, search the existing issues to avoid duplicates.
When opening an issue, include the Datadog Lambda Layer version, Node version, and stack trace if available. In addition, include the steps to reproduce when appropriate.
You can also open an issue for a feature request.
If you find an issue with this package and have a fix, please feel free to open a pull request following the procedures.
For product feedback and questions, join the #serverless
channel in the Datadog community on Slack.
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2019 Datadog, Inc.
FAQs
Lambda client library that supports hybrid tracing in node js
The npm package datadog-lambda-js receives a total of 378,016 weekly downloads. As such, datadog-lambda-js popularity was classified as popular.
We found that datadog-lambda-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.