0.1.0 • Published 3 years ago

@colecaomoda/sls-packages v0.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

sls-packages

Shared packages for AWS serverless apps

Install

$ npm install "@colecaomoda/sls-packages"

Monitoring

Metrics and error reporting helpers.

const { monitoring } = require("@colecaomoda/sls-packages")
const { monitor, incrementCounter } = monitoring
const tags = { tag1: "value", tag2: "value" }

// Record metrics during function execution such as number of calls, successes and errors.
// If an error occurs, it also reports to error tracking library.
monitor("metricName1", tags, async () => {
  // ...
})

// Manually record metric and a set of tags
incrementCounter("metricName2", tags)

Currently uses CloudWatch Metrics and AppSignal.