CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-newrelic

Application Performance Monitoring (APM) agent for Node.js applications with transaction tracing, error tracking, custom metrics, and distributed tracing capabilities.

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

aws-lambda.mddocs/

AWS Lambda Support

Serverless monitoring capabilities for AWS Lambda functions with automatic cold start detection.

Capabilities

Set Lambda Handler

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);
});

Lambda-Specific Features

The wrapped handler automatically:

  • Creates transactions for each Lambda invocation
  • Detects cold starts
  • Captures Lambda context information
  • Handles both callback and async/await patterns
  • Reports invocation duration and memory usage
  • Manages transaction lifecycle automatically

Configuration

Lambda monitoring works best with:

  • NEW_RELIC_SERVERLESS_MODE_ENABLED=true
  • Appropriate Lambda layer or deployment package
  • Sufficient memory allocation for the agent overhead

docs

aws-lambda.md

browser-monitoring.md

custom-attributes.md

custom-instrumentation.md

distributed-tracing.md

error-handling.md

index.md

llm-monitoring.md

metrics-events.md

segments-timing.md

transaction-management.md

url-naming-rules.md

utilities.md

tile.json