Application Performance Monitoring (APM) agent for Node.js applications with transaction tracing, error tracking, custom metrics, and distributed tracing capabilities.
—
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Pending
The risk profile of this skill
Serverless monitoring capabilities for AWS Lambda functions with automatic cold start detection.
Wrap AWS Lambda handler function for serverless monitoring.
/**
* Wrap AWS Lambda handler for serverless monitoring with automatic transaction management
* @param {Function} handler - Original Lambda handler function
* @returns {Function} Wrapped handler with New Relic instrumentation
*/
function setLambdaHandler(handler);Usage Examples:
const newrelic = require('newrelic');
// Basic Lambda handler wrapping
exports.handler = newrelic.setLambdaHandler((event, context, callback) => {
// Your Lambda function logic
const result = processEvent(event);
callback(null, result);
});
// Async Lambda handler
exports.handler = newrelic.setLambdaHandler(async (event, context) => {
// Async processing
const data = await fetchData(event.id);
const processed = await processData(data);
return {
statusCode: 200,
body: JSON.stringify(processed)
};
});
// Lambda handler with custom attributes
exports.handler = newrelic.setLambdaHandler(async (event, context) => {
// Add Lambda-specific attributes
newrelic.addCustomAttributes({
lambdaRequestId: context.awsRequestId,
functionName: context.functionName,
remainingTime: context.getRemainingTimeInMillis()
});
return processLambdaEvent(event);
});The wrapped handler automatically:
Lambda monitoring works best with:
NEW_RELIC_SERVERLESS_MODE_ENABLED=true