npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

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

install

npm i aws-lambda-newrelic

Downloadsweekly downloads

3

version

1.0.2

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability