aws-lambda-newrelic

1.0.2 • Public • Published

Lambda Newrelic Integration

When you create your a AWS Lambda and you need to send customEvents to Insights, you can use this library to make this task easy.

Installation

npm install --save aws-lambda-newrelic

How to Use

This packet have a function called insertCustomEvent, this function receive 3 parameters:

  • eventName: a string to define the name to the Custom Event.
  • data: JSON object structure.
  • callback: a callback function to receive (error, data).

Additional, this newrelic integration need to use two environment variables:

  • NEWRELIC_KEY: NewRelic Insert Key
  • NEWRELIC_ACCOUNT: NewRelic Account to insert

Example

  const lambdaNewRelic = require('aws-lambda-newrelic');
 
  exports.handler = (event, context, callback) => {
    // method needs at least 3 parameters
    // eventName, data, callback
    lambdaNewRelic.insertCustomEvent('TestEvent', {"name": "Alex Mejicanos"}, (error, data) => {});
    
    callback(null, 'Its Ok');
  };

Package Sidebar

Install

npm i aws-lambda-newrelic

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

2.82 kB

Total Files

3

Last publish

Collaborators

  • alexmeji