@dazn/lambda-powertools-pattern-basic
TypeScript icon, indicating that this package has built-in type declarations

1.29.0 • Public • Published

lambda-powertools-pattern-basic

A basic pattern that helps you follow our guidelines around logging and monitoring.

Main features:

  • configures Datadog metrics namespace using the function name if one is not specified already

  • configures Datadog default tags with awsRegion, functionName, functionVersion and environment

  • applies the @dazn/lambda-powertools-middleware-correlation-ids middleware at a default 1% sample rate

  • applies the @dazn/lambda-powertools-middleware-sample-logging middleware at a default 1% sample rate

  • applies the @dazn/lambda-powertools-middleware-log-timeout middleware at default 10ms threshold (i.e. log an error message 10ms before an invocation actually times out)

  • allow override for the default 1% sample rate via a SAMPLE_DEBUG_LOG_RATE environment variable, to sample debug logs at 5% rate then set SAMPLE_DEBUG_LOG_RATE to 0.05

Getting Started

Install from NPM: npm install @dazn/lambda-powertools-pattern-basic

API

const wrap = require('@dazn/lambda-powertools-pattern-basic')

module.exports.handler = wrap(async (event, context) => {
  return 42
})

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.29.0431latest

Version History

VersionDownloads (Last 7 Days)Published
1.29.0431
1.28.14
1.28.02
1.27.04
1.25.02
1.24.32
1.24.22
1.24.11
1.24.01
1.23.21
1.23.11
1.23.01
1.22.11
1.22.01
1.21.10
1.21.00
1.19.00
1.18.00
1.16.00
1.15.20
1.15.00
1.14.00
1.11.00
1.10.00
1.9.10
1.9.00
1.8.30
1.8.20
1.8.00

Package Sidebar

Install

npm i @dazn/lambda-powertools-pattern-basic

Weekly Downloads

454

Version

1.29.0

License

MIT

Unpacked Size

22.4 kB

Total Files

9

Last publish

Collaborators

  • gideonparanoid
  • davidrv87
  • gabriela_nowicka
  • dazn.builder.frontend
  • automation-drone
  • m.bazalik
  • dazn.oss.lambda.powertools