n-cloudwatch-metrics

1.0.2 • Public • Published

n-cloudwatch-metrics

A small library to send metrics to cloudwatch from your AWS lambdas, extracted from n-lambda

Usage

You will need to set up an environmental variable called AWS_REGION with the correct region for your app (e.g. eu-west-1) and an environmental variable called AWS_LAMBDA_FUNCTION_NAME.

Requiring the module will return an instance of the cloudwatch client.

const metrics = require('n-cloudwatch-metrics');

You can then call the count method on this instance with the name of the metric as the first argument. There is a second optional argument that lets you specify what the number to add to the count is. It defaults to 1.

metrics.count('nameOfMetric');
metrics.count('tenOfTheseThingsHappened', 10);

Readme

Keywords

none

Package Sidebar

Install

npm i n-cloudwatch-metrics

Weekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • robertboulton
  • seraph2000
  • hamza.samih
  • notlee
  • emmalewis
  • aendra
  • the-ft
  • rowanmanning
  • chee
  • alexwilson