1.29.0 • Published 3 years ago

@dazn/lambda-powertools-pattern-obfuscate v1.29.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

lambda-powertools-pattern-obfuscate

A pattern that helps you follow our guidelines around logging and monitoring. With added ability to obfuscate personal fields.

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-obfuscated-logging middleware with passed obfuscation filters

  • 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-obfuscate

API

const obfuscatedWrap = require('@dazn/lambda-powertools-pattern-obfuscated')

module.exports.handler = obfuscatedWrap.obfuscaterPattern(['Records.*.firstName', 'Records.*.lastName'], async (event, context) => {
  return 42
})
1.29.0

3 years ago

1.28.1

3 years ago

1.28.0

3 years ago

1.27.0

4 years ago

1.25.0

4 years ago

1.24.3

4 years ago

1.24.2

4 years ago

1.24.1

4 years ago

1.24.0

4 years ago

1.23.2

4 years ago

1.23.1

4 years ago

1.23.0

4 years ago

1.22.1

4 years ago

1.22.0

4 years ago

1.21.1

4 years ago

1.21.0

4 years ago

1.19.0

4 years ago

1.18.0

4 years ago

1.16.0

4 years ago

1.15.5

4 years ago

1.15.4

4 years ago

1.15.3

4 years ago

1.15.2

4 years ago

1.15.0

4 years ago

1.14.0

5 years ago

1.12.1

5 years ago

1.11.0

5 years ago

1.10.0

5 years ago

1.9.1

5 years ago

1.9.0

5 years ago

1.8.3

5 years ago

1.8.2

5 years ago

1.8.0

5 years ago