Releases: aws-powertools/powertools-lambda-typescript
v0.11.1-rc.0
Summary
With this release, we move from beta developer preview to Release Candidate (RC) 🎉 🎉 🎉
In this stage we are looking to gather as much feedback as possible as well as discovering unknown unknowns that might have slipped through the unit and integration test cases we have implemented so far.
We consider the Logger, Metrics, and Tracer utilities complete in terms of features but we anticipate that there might be some additional releases between now and the General Availability release to fix any bug or issue that are found.
Over the next few weeks we encourage all of you to try the new RC release(s) and let us know what you think as well as reporting any issue or sharp edge that you might find. We will be doing the same and test-drive the utilities in some non-trivial workloads.
Finally, we want to take a moment to thank you all for the patience and the enthusiasm towards the project that we have seen so far. We know that we have a long way to go and we look forward to see what you will do with AWS Powertools for TypeScript; now go build 🔧!
Changes
🔧 Maintenance
- chore: updated rc release flow (#1005) by @dreamorosi
This release was made possible by the following contributors:
v0.11.0
Summary
This release introduces 2 main features for the Logger utility: clear state functionality, and log event.
Clear state
The Logger utility is commonly initialized in the global scope, outside the handler function.
When you attach persistent log attributes through the persistentLogAttributes
constructor option or via the appendKeys
, addPersistentLogAttributes
methods, this data is attached to the Logger instance.
Due to the Lambda Execution Context reuse, this means those persistent log attributes may be reused across invocations.
This PR introduces a new flag that developers can enable to "clear the state" across invocations.
If developers want to make sure that persistent attributes added inside the handler function code are not persisted across invocations, they can now set the parameter clearState
as true
in the injectLambdaContext
middleware or decorator.
Log event
This PR introduces a new functionality: logging Lambda events. Developers can opt in for this behaviour by one of the following methods:
- passing the parameter
logEvent
set totrue
to theinjectLambdaContext
middleware - passing the parameter
logEvent
set totrue
to theinjectLambdaContext
decorator - setting the env var
POWERTOOLS_LOGGER_LOG_EVENT
to through while using the injectLambdaContext middleware/decorator
Note that this functionality is only available when using a middleware or decorator.
The Lambda invocation will then print one log item with the following key-value pairs:
logLevel
INFOmessage
key with valueLambda invocation event
event
key with the current Lambda invocation event as value
Logging a Lambda event is very typical use of a logger in AWS Lambda. This logic aims to simplify and reduce the code that developers need to maintain.
Improvements
We disabled the dependabot updates in favour of periodic, manual dependencies upgrades as the current dependabot setup was disrupting the maintainers' focus and was polluting out PRs.
We also added a useful Github Action plugin that will comment the size of the utilities package so we can monitor it we are add code or dependencies.
Changes
- build: bump examples version (#928) by @dreamorosi
🌟New features and non-breaking changes
- Feat(logger): log event functionality (#1004) by @saragerion
- Feat(logger): add clear state functionality (#902) by @saragerion
🔧 Maintenance
- chore: disable dependabot for dependencies upgrades (#992) by @dreamorosi
- feat (build): Add package size check in PR workflow (#878) by @flochaz
- build(deps-dev): bump esbuild from 0.14.45 to 0.14.46 (#985) by @dependabot
- build(deps): bump aws-sdk from 2.1156.0 to 2.1157.0 (#984) by @dependabot
- build(deps-dev): bump typescript from 4.7.3 to 4.7.4 (#982) by @dependabot
- build(deps-dev): bump eslint from 8.17.0 to 8.18.0 (#983) by @dependabot
- build(deps-dev): bump @types/node from 17.0.42 to 18.0.0 (#973) by @dependabot
- build(deps-dev): bump esbuild from 0.14.43 to 0.14.45 (#971) by @dependabot
- build(deps): bump aws-sdk from 2.1152.0 to 2.1156.0 (#976) by @dependabot
- build(deps): bump mkdocs-material from 8.3.3 to 8.3.6 in /docs (#981) by @dependabot
- build(deps-dev): bump @typescript-eslint/parser from 5.27.1 to 5.28.0 (#968) by @dependabot
- build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.27.1 to 5.28.0 (#969) by @dependabot
- build(deps): bump broken Depdendabot deps (#945) by @dreamorosi
- build(deps-dev): bump @types/node from 17.0.41 to 17.0.42 (#961) by @dependabot
- build(deps): bump @aws-sdk/client-sts from 3.100.0 to 3.105.0 (#948) by @dependabot
- build(deps-dev): bump typescript from 4.6.4 to 4.7.3 (#953) by @dependabot
- build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.27.0 to 5.27.1 (#959) by @dependabot
- build(deps): bump @types/aws-lambda from 8.10.97 to 8.10.100 (#955) by @dependabot
- build(deps-dev): bump esbuild from 0.14.42 to 0.14.43 (#954) by @dependabot
- build(deps-dev): bump @typescript-eslint/parser from 5.27.0 to 5.27.1 (#958) by @dependabot
- build(deps): bump aws-sdk from 2.1148.0 to 2.1152.0 (#949) by @dependabot
- build(deps): bump mkdocs-material from 8.3.0 to 8.3.3 in /docs (#957) by @dependabot
- build(deps-dev): bump @commitlint/cli from 17.0.1 to 17.0.2 (#952) by @dependabot
- build(deps-dev): bump eslint from 8.16.0 to 8.17.0 (#950) by @dependabot
- build(deps-dev): bump @types/node from 17.0.38 to 17.0.41 (#960) by @dependabot
- build(deps): bump actions/setup-python from 3 to 4 (#947) by @dependabot
- build(deps-dev): bump ts-node from 10.8.0 to 10.8.1 (#946) by @dependabot
- build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.26.0 to 5.27.0 (#940) by @dependabot
- build(deps-dev): bump typedoc from 0.22.15 to 0.22.17 (#935) by @dependabot
- build(deps): bump aws-cdk-lib from 2.25.0 to 2.27.0 (#942) by @dependabot
- build(deps-dev): bump @aws-cdk/cloudformation-diff from 2.25.0 to 2.27.0 (#937) by @dependabot
- build(deps): bump constructs from 10.1.19 to 10.1.25 (#933) by @dependabot
- build(deps-dev): bump cdk-assets from 2.25.0 to 2.27.0 (#931) by @dependabot
- build(deps-dev): bump @aws-cdk/cx-api from 2.25.0 to 2.27.0 (#929) by @dependabot
- build(deps): bump @aws-sdk/client-sts from 3.95.0 to 3.100.0 (#917) by @dependabot
- build(deps-dev): bump @types/node from 17.0.35 to 17.0.38 (#939) by @dependabot
- build(deps-dev): bump @typescript-eslint/parser from 5.26.0 to 5.27.0 (#943) by @dependabot
- build(deps-dev): bump esbuild from 0.14.40 to 0.14.42 (#941) by @dependabot
- build(deps): bump mkdocs-material from 8.2.15 to 8.3.0 in /docs (#944) by @dependabot
- build(deps): bump aws-sdk from 2.1140.0 to 2.1148.0 (#930) by @dependabot
This release was made possible by the following contributors:
@dependabot, @dependabot[bot], @dreamorosi, @flochaz and @saragerion
v0.10.0
Summary
This release adds support for the Node.js 16.x runtime that has recently been released for AWS Lambda, as well as extending support to the Node.js 12.x one by moving to es2019
as transpile target.
Additionally, this release introduces the option of removing persistent keys from a logger instance. This can be done using the newly introduced removeKeys
method that accepts as parameter an array of keys to be removed.
Changes
🌟New features and non-breaking changes
- feat(logger): add removeKeys functionality (#901) by @saragerion
- feat(all): nodejs16x support (#877) by @dreamorosi
📜 Documentation updates
- chore(examples): updated contributing & docs with SAM (#876) by @dreamorosi
🐛 Bug and hot fixes
- build(all): use es2019 target to support on Node12 (#925) by @ijemmy
- fix(commons): rename tests subfolder to samples to avoid being deleted by tools such as node-prune (#882) by @flochaz
🔧 Maintenance
- chore(examples): cleanup old examples (#903) by @dreamorosi
- build(deps): bump constructs from 10.1.12 to 10.1.19 (#920) by @dependabot
- build(deps-dev): bump @aws-cdk/cx-api from 2.24.1 to 2.25.0 (#913) by @dependabot
- build(deps-dev): bump @aws-cdk/cloudformation-diff from 2.24.1 to 2.25.0 (#911) by @dependabot
- build(deps-dev): bump cdk-assets from 2.24.1 to 2.25.0 (#907) by @dependabot
- build(deps): bump aws-cdk-lib from 2.24.1 to 2.25.0 (#904) by @dependabot
- build(deps-dev): bump @types/lodash.pickby from 4.6.6 to 4.6.7 (#914) by @dependabot
- build(deps-dev): bump @types/lodash.clonedeep from 4.5.6 to 4.5.7 (#906) by @dependabot
- build(deps-dev): bump esbuild from 0.14.39 to 0.14.40 (#905) by @dependabot
- build(deps-dev): bump ts-node from 10.7.0 to 10.8.0 (#908) by @dependabot
- build(deps-dev): bump eslint from 8.15.0 to 8.16.0 (#910) by @dependabot
- build(deps-dev): bump @typescript-eslint/parser from 5.25.0 to 5.26.0 (#918) by @dependabot
- build(deps-dev): bump @commitlint/cli from 17.0.0 to 17.0.1 (#919) by @dependabot
- build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.25.0 to 5.26.0 (#922) by @dependabot
- build(deps-dev): bump axios from 0.27.1 to 0.27.2 (#923) by @dependabot
- chore(examples): updated contributing & docs with SAM (#876) by @dreamorosi
This release was made possible by the following contributors:
v0.9.1
Summary
@AWSDB introduces a change that relaxes the restrictions introduced by #614. In #565, we decided to restrict the additional logging data objects in their shape. It turned out, that this restriction prevents from logging of arbitrary objects, which is inconvenient.
In his change, type restrictions are removed, so it is now possible to specify any object as additional payload when calling the logger methods directly.
Changes
🐛 Bug and hot fixes
🔧 Maintenance
- build(deps): bump aws-sdk from 2.1134.0 to 2.1140.0 (#900) by @dependabot
- build(deps-dev): bump @aws-sdk/client-dynamodb from 3.58.0 to 3.95.0 (#891) by @dependabot
- build(deps-dev): bump @types/lodash.pickby from 4.6.6 to 4.6.7 (#892) by @dependabot
- build(deps-dev): bump @typescript-eslint/parser from 5.23.0 to 5.25.0 (#893) by @dependabot
- build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.23.0 to 5.25.0 (#894) by @dependabot
- build(deps): bump constructs from 10.1.7 to 10.1.12 (#895) by @dependabot
- build(deps-dev): bump @types/lodash.merge from 4.6.6 to 4.6.7 (#896) by @dependabot
- build(deps-dev): bump axios from 0.27.1 to 0.27.2 (#897) by @dependabot
- build(deps): bump @aws-sdk/client-sts from 3.87.0 to 3.95.0 (#889) by @dependabot
- build(deps-dev): bump @commitlint/cli from 16.2.4 to 17.0.0 (#886) by @dependabot
- build(deps-dev): bump @types/node from 17.0.33 to 17.0.35 (#888) by @dependabot
- build(deps-dev): bump @types/lodash.clonedeep from 4.5.6 to 4.5.7 (#885) by @dependabot
- build(deps): bump aws-xray-sdk-core from 3.3.4 to 3.3.5 (#887) by @dependabot
- build(deps): bump mkdocs-material from 8.2.14 to 8.2.15 in /docs (#898) by @dependabot
This release was made possible by the following contributors:
@AWSDB, @dependabot and @dependabot[bot]
v0.9.0
Summary
This release introduces a range of new improvements.
SAM example
Thanks to @bpauwels's contribution, we now have a deployable example that relies on SAM CLI.
Now the folder examples/sam
contains source code and supporting files for a serverless application that you can deploy with the SAM CLI.
The application uses several AWS resources, including Lambda functions and an API Gateway API. These resources are defined in the template.yaml
file.
E2E tests improvements
@ijemmy worked on a refactor of our E2E tests, which are now more stable. Changes include but are not limited to: usage of Github Actions matrix, testing of Node.js runtime version 12 and 14, and unique stack names.
Correct record of xray_trace_id in log items
As reported by user @humanzz in #773 the Logger utility was not including the xray_trace_id
key in logs. This field is listed in the documentation as a standard key that should appear in each log.
xray_trace_id
is now correctly appearing in the logs.
Changes
🌟New features and non-breaking changes
- feat(examples): added sam example to workflows (#849) by @dreamorosi
📜 Documentation updates
🐛 Bug and hot fixes
- fix(actions): reintroduce token to checkout repo in release workflow (#848) by @dreamorosi
- fix(logger): add xray_trace_id to every log (#776) by @dreamorosi
- fix(actions): added back fetch-depth: 0 (#812) by @dreamorosi
- fix(actions): removed token from remaining actions (#805) by @dreamorosi
🔧 Maintenance
- build(deps): bump aws-cdk-lib from 2.23.0 to 2.24.1 (#874) by @dependabot
- build(deps-dev): bump @aws-cdk/cx-api from 2.23.0 to 2.24.1 (#873) by @dependabot
- build(deps-dev): bump @aws-cdk/cloudformation-diff from 2.23.0 to 2.24.1 (#871) by @dependabot
- build(deps-dev): bump cdk-assets from 2.23.0 to 2.24.1 (#868) by @dependabot
- build(deps-dev): bump @types/lodash.clonedeep from 4.5.6 to 4.5.7 (#870) by @dependabot
- build(deps-dev): bump @types/lodash.pickby from 4.6.6 to 4.6.7 (#869) by @dependabot
- build(deps-dev): bump @types/lodash.merge from 4.6.6 to 4.6.7 (#866) by @dependabot
- build(deps-dev): bump @aws-sdk/client-dynamodb from 3.58.0 to 3.87.0 (#872) by @dependabot
- build(deps): bump aws-sdk from 2.1133.0 to 2.1134.0 (#862) by @dependabot
- build(deps): bump aws-xray-sdk-core from 3.3.4 to 3.3.5 (#867) by @dependabot
- build(deps-dev): bump @types/node from 17.0.32 to 17.0.33 (#857) by @dependabot
- build(deps): bump release-drafter/release-drafter from 5.19.0 to 5.20.0 (#858) by @dependabot
- build(deps): bump mkdocs-material from 8.2.13 to 8.2.14 in /docs (#865) by @dependabot
- chore(tracer): rename package folder to tracer (#854) by @dreamorosi
- build(deps): bump constructs from 10.1.5 to 10.1.7 (#853) by @dependabot
- build(deps-dev): bump @types/node from 17.0.31 to 17.0.32 (#852) by @dependabot
- build(deps): bump aws-sdk from 2.1132.0 to 2.1133.0 (#851) by @dependabot
- build(deps-dev): bump esbuild from 0.14.38 to 0.14.39 (#850) by @dependabot
- fix(actions): reintroduce token to checkout repo in release workflow (#848) by @dreamorosi
- build(deps): bump aws-sdk from 2.1131.0 to 2.1132.0 (#847) by @dependabot
- build(deps-dev): bump @typescript-eslint/parser from 5.21.0 to 5.23.0 (#844) by @dependabot
- build(deps-dev): bump @aws-cdk/cloudformation-diff from 2.22.0 to 2.23.0 (#843) by @dependabot
- build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.21.0 to 5.23.0 (#841) by @dependabot
- build(deps-dev): bump cdk-assets from 2.22.0 to 2.23.0 (#842) by @dependabot
- Add class documentation FunctionSegmentNotDefinedErrorunexpected and make end_time optional (#845) by @ijemmy
- build(deps-dev): bump @aws-cdk/cx-api from 2.22.0 to 2.23.0 (#840) by @dependabot
- build(deps): bump constructs from 10.0.127 to 10.1.5 (#839) by @dependabot
- build(deps): bump aws-cdk-lib from 2.22.0 to 2.23.0 (#838) by @dependabot
- build(deps-dev): bump @types/node from 17.0.30 to 17.0.31 (#837) by @dependabot
- build(deps): bump aws-sdk from 2.1124.0 to 2.1131.0 (#836) by @dependabot
- build(deps-dev): bump husky from 7.0.4 to 8.0.1 (#835) by @dependabot
- build(deps): bump @aws-sdk/client-sts from 3.80.0 to 3.87.0 (#834) by @dependabot
- build(deps-dev): bump @types/jest from 27.4.1 to 27.5.0 (#833) by @dependabot
- build(deps-dev): bump eslint from 8.14.0 to 8.15.0 (#832) by @dependabot
- build(deps): bump @types/aws-lambda from 8.10.95 to 8.10.97 (#831) by @dependabot
- test(all): switch to use GitHub strategy matrix and fix flaky tests (#828) by @ijemmy
- build(deps): bump mkdocs-material from 8.2.11 to 8.2.13 in /docs (#827) by @dependabot
- test(tracer): make e2e tests to follow the same convention in Logger and Metrics (#788) by @ijemmy
- build(deps-dev): bump typescript from 4.6.3 to 4.6.4 (#824) by @dependabot
- build(deps-dev): bump @aws-cdk/cloudformation-diff from 2.21.1 to 2.22.0 (#823) by @dependabot
- build(deps): bump constructs from 10.0.126 to 10.0.127 (#822) by @dependabot
- build(deps-dev): bump @commitlint/cli from 16.2.3 to 16.2.4 (#821) by @dependabot
- build(deps): bump aws-sdk from 2.1122.0 to 2.1124.0 (#819) by @dependabot
- build(deps-dev): bump cdk-assets from 2.21.1 to 2.22.0 (#820) by @dependabot
- build(deps): bump aws-cdk-lib from 2.21.1 to 2.22.0 (#818) by @dependabot
- build(deps-dev): bump @types/node from 17.0.27 to 17.0.30 (#817) by @dependabot
- build(deps): bump @aws-sdk/client-sts from 3.76.0 to 3.80.0 (#816) by @dependabot
- build(deps-dev): bump @aws-cdk/cx-api from 2.21.1 to 2.22.0 (#815) by @dependabot
- build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.20.0 to 5.21.0 (#810) by @dependabot
- build(deps): bump constructs from 10.0.118 to 10.0.126 (#809) by @dependabot
- build(deps-dev): bump axios from 0.26.1 to 0.27.1 (#807) by @dependabot
- build(deps): bump aws-sdk from 2.1121.0 to 2.1122.0 (#813) by @dependabot
- build(deps-dev): bump @typescript-eslint/parser from 5.20.0 to 5.21.0 (#806) by @dependabot
- build(deps-dev): bump eslint from 8.13.0 to 8.14.0 (#804) by @dependabot
- build(deps): bump aws-cdk-lib from 2.20.0 to 2.21.1 (#803) by @dependabot
- build(deps): bump @types/aws-lambda from 8.10.93 to 8.10.95 (#801) by @dependabot
- build(deps-dev): bump esbuild from 0.14.36 to 0.14.38 (#800) by @dependabot
- build(deps-dev): bump @types/node from 17.0.26 to 17.0.27 (#808) by @dependabot
- build(deps-dev): bump @aws-cdk/cloudformation-diff from 2.20.0 to 2.21.1 (#802) by @dependabot
- build(deps-dev): bump @aws-cdk/cx-api from 2.20.0 to 2.21.1 (#799) by @dependabot
- build(deps): bump aws-sdk from 2.1116.0 to 2.1121.0 (#811) by @dependabot
- build(deps): bump @aws-sdk/client-sts from 3.72.0 to 3.76.0 (#797) by @dependabot
- build(deps): bump mkdocs-material from 8.2.7 to 8.2.11 in /docs (#798) by @dependabot
- build(deps-dev): bump cdk-assets from 2.20.0 to 2.21.1 (#794) by @dependabot
- fix(actions): added back fetch-depth: 0 (#812) by @dreamorosi
- build(deps-dev): bump @types/node from 17.0.24 to 17.0.26 (#795) by @dependabot
- fix(actions): removed token from remaining actions (#805) by @dreamorosi
- chore: updated depdendabot configs (#766) by @dreamorosi
- build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.19.0 to 5.20.0 (#783) by @dependabot
- build(deps-dev): bump @typescript-eslint/parser from 5.19.0 to 5.20.0 (#782) by @dependabot
- build(deps): bump aws-sdk from 2.1115.0 to 2.1116.0 (#780) by @dependabot
- build(deps): bump constructs from 10.0.115 to 10.0.118 (#781) by @dependabot
- build(deps-dev): bump archiver from 5.3.0 to 5.3.1 (#779) by @dependabot
- build(deps): bump @aws-sdk/client-sts from 3.67.0 to 3.72.0 (#778) by @dependabot
- build(deps-dev): bump concurrently from 7.0.0 to 7.1.0 (#772) by @dependabot
- build(deps-dev): bump @aws-sdk/client-dynamodb from 3.58.0 to 3.67.0 (#771) by @dependabot
- build(deps): bump aws-sdk from 2.1114.0 to 2.1115.0 (#775) by @dependabot
- build(deps): bump constructs from 10.0.114 to 10.0.115 (#774) by @dependabot
- build(deps-dev): bump @types/node from 17.0.23 to 17.0.24 (#769) by @dependabot
- build(deps): bump aws-sdk from 2.1113.0 to 2.1114.0 (#770) by @dependabot
- build(deps): bump constructs from 10.0.113 to 10.0.114 (#768) by @dependabot
This release was made possible by the following contributors:
@bpauwels, @dependabot, @dependabot[bot], @dreamorosi and @ijemmy
v0.8.1
Summary
This is a patch release for those using Logger together with 3rd party providers like New Relic, Honeycomb, and others. This release ensures that all the log entries generated by the utility are valid JSON strings.
Logger emitting valid JSON strings
Before:
2022-04-08T10:58:44.811Z b6511ee9-4873-404e-b60c-a23cb45d3ff2 INFO {"cold_start":false,"function_arn":"arn:aws:lambda:eu-west-2:12345:function:test","function_memory_size":1024,"function_name":"test","function_request_id":"b6511ee9-4873-404e-b60c-a23cb45d3ff2","level":"INFO","message":"test message","service":"test","timestamp":"2022-04-08T10:58:44.811Z"}
After:
{"cold_start":false,"function_arn":"arn:aws:lambda:eu-west-2:12345:function:test","function_memory_size":1024,"function_name":"test","function_request_id":"b6511ee9-4873-404e-b60c-a23cb45d3ff2","level":"INFO","message":"test message","service":"test","timestamp":"2022-04-08T10:58:44.811Z"}
As detailed in the AWS Lambda docs:
The Node.js runtime logs the START, END, and REPORT lines for each invocation. It adds a timestamp, request ID, and log level to each entry logged by the function.
This behaviour is handy for those who have not adopted structured logging and that are using Amazon CloudWatch to store their logs as it adds context to each log entry without any extra code in the function.
For those who instead prefer to bring their logs elsewhere, and have decided to use JSON to format their logs, the presence of the prefix makes it harder to ingest and process the logs.
Starting with this release all the logs emitted by Logger won't have the prefix and will instead be a valid JSON that can be parsed as such.
Big shoutout to @olanb7 for reporting this on the #lambda-powertools
channel part of the AWS Developers Slack (Join here!)
Changes
🐛 Bug and hot fixes
- fix(logger): change logging to use stdout (#748) by @dreamorosi
🔧 Maintenance
- build(deps): bump constructs from 10.0.112 to 10.0.113 (#765) by @dependabot
- build(deps-dev): bump esbuild from 0.14.34 to 0.14.36 (#761) by @dependabot
- build(deps): bump aws-sdk from 2.1111.0 to 2.1113.0 (#764) by @dependabot
- build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.18.0 to 5.19.0 (#763) by @dependabot
- build(deps): bump constructs from 10.0.110 to 10.0.112 (#760) by @dependabot
- build(deps-dev): bump @typescript-eslint/parser from 5.18.0 to 5.19.0 (#759) by @dependabot
- build(deps): bump @aws-sdk/client-sts from 3.58.0 to 3.67.0 (#758) by @dependabot
- build(deps-dev): bump typedoc from 0.22.14 to 0.22.15 (#757) by @dependabot
- build(deps): bump constructs from 10.0.108 to 10.0.110 (#754) by @dependabot
- build(deps-dev): bump eslint from 8.12.0 to 8.13.0 (#755) by @dependabot
- build(deps): bump aws-actions/stale-issue-cleanup from e9f9e34 to 5 (#753) by @dependabot
- build(deps): bump aws-sdk from 2.1110.0 to 2.1111.0 (#756) by @dependabot
- build(deps): bump actions/upload-artifact from 2 to 3 (#752) by @dependabot
- build(deps-dev): bump concurrently from 7.0.0 to 7.1.0 (#746) by @dependabot
This release was made possible by the following contributors:
v0.8.0
Summary
This release adds a new feature to the Tracer utility that allows you to automatically capture traces for HTTP requests without changing your code.
Capturing HTTP requests with Tracer
You can now use Tracer to capture requests to HTTP APIs. The utility automatically traces those calls and adds the API to the service graph as a downstream service.
Tracer patches the http
and https
modules from the standard library. This means that request libraries that are based on one of these modules should be instrumented automatically.
The service graph shown in the screenshot above was generated using the popular axios
library:
import { Tracer } from '@aws-lambda-powertools/tracer';
import axios from 'axios';
const tracer = new Tracer({ serviceName: 'serverlessAirline' });
export const handler = async (event: unknown, context: Context): Promise<void> => {
await axios.get('https://httpbin.org/status/200');
};
Translating to the following traces:
The feature is enabled by default and HTTP requests should be automatically start being traced once you upgrade @aws-lambda-powertools/tracer
to v0.8.0
or above.
You can opt-out by setting the POWERTOOLS_TRACER_CAPTURE_HTTPS_REQUESTS
environment variable to false
or by passing the captureHTTPSRequests: false
option to the Tracer constructor:
const tracer = new Tracer({
serviceName: 'serverlessAirline',
captureHTTPSRequests: false // Tracer won't capture any trace for your HTTP requests
});
Changes
🌟New features and non-breaking changes
- feat: added captureHTTPsRequest feature (#677) by @dreamorosi
🔧 Maintenance
- build(deps): bump aws-sdk from 2.1109.0 to 2.1110.0 (#744) by @dependabot
- build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.17.0 to 5.18.0 (#743) by @dependabot
- build(deps): bump aws-cdk-lib from 2.19.0 to 2.20.0 (#742) by @dependabot
- build(deps-dev): bump @aws-cdk/cloudformation-diff from 2.19.0 to 2.20.0 (#741) by @dependabot
- build(deps-dev): bump cdk-assets from 2.19.0 to 2.20.0 (#740) by @dependabot
- build(deps-dev): bump eslint-plugin-import from 2.25.4 to 2.26.0 (#739) by @dependabot
- build(deps-dev): bump @aws-cdk/cx-api from 2.19.0 to 2.20.0 (#738) by @dependabot
- build(deps-dev): bump typedoc from 0.22.13 to 0.22.14 (#737) by @dependabot
- build(deps): bump constructs from 10.0.102 to 10.0.108 (#735) by @dependabot
- build(deps-dev): bump esbuild from 0.14.29 to 0.14.34 (#734) by @dependabot
- build(deps-dev): bump @typescript-eslint/parser from 5.17.0 to 5.18.0 (#725) by @dependabot
- build(deps-dev): bump eslint-import-resolver-typescript from 2.7.0 to 2.7.1 (#720) by @dependabot
- build(deps): bump aws-sdk from 2.1105.0 to 2.1109.0 (#736) by @dependabot
- build(deps-dev): bump @aws-sdk/client-dynamodb from 3.55.0 to 3.58.0 (#719) by @dependabot
This release was made possible by the following contributors:
v0.7.2
Summary
This is a maintenance release in which we have bumped several development dependencies. Our work on improving the confidence of our tests continues, we have extended our test matrix to more utilities as well as completely migrate the setup of the integration tests to aws-cdk-lib
.
📜 Documentation updates
- build(docs): updated docs dependencies (#688) by @dreamorosi
🔧 Maintenance
- build(deps-dev): bump cdk-assets from 2.18.0 to 2.19.0 (#718) by @dependabot
- build(deps): bump aws-sdk from 2.1104.0 to 2.1105.0 (#716) by @dependabot
- build(deps-dev): bump @aws-cdk/cx-api from 2.18.0 to 2.19.0 (#715) by @dependabot
- build(deps): bump aws-cdk-lib from 2.18.0 to 2.19.0 (#714) by @dependabot
- build(deps-dev): bump @aws-cdk/cloudformation-diff from 2.18.0 to 2.19.0 (#713) by @dependabot
- build(deps): bump constructs from 10.0.101 to 10.0.102 (#712) by @dependabot
- build(dev-deps): bump @types/jest (#717) by @dreamorosi
- build(dev-deps): bump jest in examples to latest (#711) by @dreamorosi
- build(deps): bump aws-cdk-lib from 2.17.0 to 2.18.0 (#710) by @dependabot
- build(deps): bump constructs from 10.0.92 to 10.0.101 (#709) by @dependabot
- build(deps-dev): bump eslint from 8.11.0 to 8.12.0 (#708) by @dependabot
- build(deps-dev): bump cdk-assets from 2.17.0 to 2.18.0 (#703) by @dependabot
- build(deps-dev): bump @aws-cdk/cloudformation-diff from 2.17.0 to 2.18.0 (#705) by @dependabot
- build(deps-dev): bump @aws-cdk/cx-api from 2.17.0 to 2.18.0 (#702) by @dependabot
- build(deps-dev): bump ts-jest from 27.1.3 to 27.1.4 (#706) by @dependabot
- build(deps): bump @aws-sdk/client-sts from 3.53.0 to 3.58.0 (#707) by @dependabot
- build(deps-dev): bump eslint-import-resolver-typescript from 2.5.0 to 2.7.0 (#701) by @dependabot
- build(deps-dev): bump @commitlint/cli from 16.2.1 to 16.2.3 (#704) by @dependabot
- build(deps-dev): bump jest-runner-groups from 2.1.0 to 2.2.0 (#700) by @dependabot
- build(deps-dev): bump @typescript-eslint/parser from 5.14.0 to 5.17.0 (#699) by @dependabot
- build(deps-dev): bump typescript from 4.6.2 to 4.6.3 (#698) by @dependabot
- build(deps): bump aws-sdk from 2.1092.0 to 2.1104.0 (#697) by @dependabot
- build(deps-dev): bump esbuild from 0.14.26 to 0.14.29 (#696) by @dependabot
- build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.14.0 to 5.17.0 (#693) by @dependabot
- build(deps-dev): bump @types/node from 17.0.21 to 17.0.23 (#685) by @dependabot
- build(deps): bump hosted-git-info from 4.1.0 to 5.0.0 (#680) by @dependabot
- build(docs): updated docs dependencies (#688) by @dreamorosi
- build(deps): bump minimist from 1.2.5 to 1.2.6 in /examples/cdk (#686) by @dependabot
- build(deps): bump minimist from 1.2.5 to 1.2.6 (#687) by @dependabot
- test(common,logger,metrics): run e2e tests for metrics in both Node runtimes (#678) by @ijemmy
- test(all): move e2e tests to cdk v2 (#676) by @flochaz
This release was made possible by the following contributors:
@dreamorosi, @flochaz and @ijemmy
v0.7.1
Summary
This release introduces a number of improvements around our E2E tests and documentation.
@AWSDB addresses the issue of the AWS Lambda function invocation mode in the E2E tests for the Logger package.
Previously, multiple function invocations have always been performed in parallel. However, this made all the cold start checks impossible, because parallel invocations cause multiple cold starts.
The invokeFunction helper function now has an additional optional parameter invocationMode with allowed options PARALLEL
or SEQUENTIAL
. This parameter lets the invokers control how to call the function-under-test.
invocationLogs = await invokeFunction(functionName, 2, 'SEQUENTIAL');
Another improvement introduced by @AWSDB is aligning the implementation of the Logger to other AWS Lambda Powertools flavors like e.g. Python when it comes to log parameters.
Now developers can write logs also in this format:
// 6) simple string
logger.info('This is the message value', 'Additional string value');
Additionally:
- passing multiple objects is restricted to only { key: 'value' } (key-value) kind of ones
- in general, passing arrays and other unknown objects is not supported anymore (BREAKING)
- passing multiple strings and Errors is not supported anymore (BREAKING)
Documentation improvements include adding a Table of Content in Github's README and CONTRIBUITING files by @ijemmy, and add mermaid diagrams support by @dreamorosi.
Changes
📜 Documentation updates
- docs(all): add toc to README.md and CONTRIBUTING.md (#623) by @ijemmy
- docs: fixed naming notes (#642) by @dreamorosi
- build(dev-deps): add mermaid plugin to docs (#641) by @dreamorosi
🐛 Bug and hot fixes
- fix(logger): enable sequential invocation in e2e test (#658) by @AWSDB
- fix(logger): fix handling of additional log keys (#614) by @AWSDB
🔧 Maintenance
- build(dev-deps): add mermaid plugin to docs (#641) by @dreamorosi
- build(deps-dev): bump esbuild from 0.14.25 to 0.14.26 (#659) by @dependabot
- build(deps-dev): bump eslint from 8.10.0 to 8.11.0 (#661) by @dependabot
- build(deps): bump aws-cdk-lib from 2.15.0 to 2.16.0 (#660) by @dependabot
- build(deps): bump aws-sdk from 2.1089.0 to 2.1092.0 (#655) by @dependabot
- build(deps): bump release-drafter/release-drafter from 5.18.1 to 5.19.0 (#656) by @dependabot
- build(deps): bump constructs from 10.0.82 to 10.0.87 (#657) by @dependabot
- fix(tracer, metrics): use polling instead of fixed wait in e2e tests (#654) by @AWSDB
- build(deps): bump aws-sdk from 2.1088.0 to 2.1089.0 (#645) by @dependabot
- build(deps): updated dependencies in examples (#643) by @dreamorosi
This release was made possible by the following contributors:
@AWSDB, @dependabot, @dependabot[bot], @dreamorosi and @ijemmy
v0.7.0
Summary
This release continues our efforts of reducing code duplication across utilities and brings a number of housekeeping changes on documentation and configurations.
Starting from this release all the three core utilities (Logger
#550, Metrics
#548, and Tracer
#549) are now using the new cold start heuristic introduced in commons
in the previous release. In addition to reducing the code surface to maintain this also reduces the size of the deployment package for those using two or more utilities in their AWS Lambda functions.
Along the same lines, this release also converts @types/aws-lambda
in the commons
to a devDependency
, continuing our efforts to remove unnecessary code from the deployment packages of our customers using AWS Lambda Powertools.
This release also sees three first-time contributors: @AWSDB, @SH4DY, and @goverdhan07 who have helped improving the documentation and the experience for other contributors 🎉
Changes
🌟New features and non-breaking changes
- feat(logger): adopted Utility class & updated unit tests (#550) by @dreamorosi
- feat(tracer): adopted Utility class & updated unit tests (#549) by @dreamorosi
- feat(metrics): adopted Utility class (#548) by @dreamorosi
🌟 Minor Changes
- docs: Add usage sub-section in docs (#604) by @dreamorosi
- feat(logger): adopted Utility class & updated unit tests (#550) by @dreamorosi
- feat(tracer): adopted Utility class & updated unit tests (#549) by @dreamorosi
- feat(metrics): adopted Utility class (#548) by @dreamorosi
📜 Documentation updates
- docs: updated project names to aws lambda power tools for typescript (#628) by @goverdhan07
- docs: Add usage sub-section in docs (#604) by @dreamorosi
- docs: improve CONTRIBUTING.md (#618) by @AWSDB
- docs: added summary section to contributing docs (#573) by @dreamorosi
🔧 Maintenance
- build(deps): bump aws-cdk-lib from 2.14.0 to 2.15.0 (#611) by @dependabot
- build(deps-dev): bump @typescript-eslint/parser from 5.13.0 to 5.14.0 (#640) by @dependabot
- build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.13.0 to 5.14.0 (#639) by @dependabot
- build(deps-dev): bump typedoc from 0.22.12 to 0.22.13 (#637) by @dependabot
- build(deps-dev): bump typescript from 4.5.5 to 4.6.2 (#635) by @dependabot
- build(deps): bump constructs from 10.0.74 to 10.0.82 (#634) by @dependabot
- build(deps): bump aws-sdk from 2.1084.0 to 2.1088.0 (#633) by @dependabot
- build(deps): bump actions/checkout from 2 to 3 (#632) by @dependabot
- build(deps-dev): bump ts-node from 10.6.0 to 10.7.0 (#631) by @dependabot
- build(deps-dev): bump esbuild from 0.14.23 to 0.14.25 (#625) by @dependabot
- chore(examples/cdk): Unpin CDK CLI in devDependencies of CDK examples (#615) by @SH4DY
- build(dev-deps): consolidate all common dev deps in workspaces (#605) by @dreamorosi
- build(deps): bump @aws-sdk/client-sts from 3.52.0 to 3.53.0 (#595) by @dependabot
- build(deps): bump constructs from 10.0.70 to 10.0.74 (#601) by @dependabot
- build(deps): bump actions/setup-python from 2.3.2 to 3 (#599) by @dependabot
- build(deps): bump aws-cdk-lib from 2.13.0 to 2.14.0 (#603) by @dependabot
- build(deps): bump actions/setup-node from 2 to 3 (#600) by @dependabot
- build(deps-dev): bump esbuild from 0.14.x to 0.14.23 (#589) by @dreamorosi
- build(deps): bump @aws-sdk/client-sts from 3.48.0 to 3.52.0 (#586) by @dependabot
- build(deps): bump actions/github-script from 5 to 6 (#553) by @dependabot
- build(deps): bump constructs from 10.0.16 to 10.0.70 (#579) by @dependabot
- build(deps): bump aws-cdk-lib from 2.0.0 to 2.13.0 (#582) by @dependabot
- chore: updated dependencies (#569) by @dreamorosi
- chore: update actions to npm8 (#570) by @dreamorosi
- improv: github issues template, RFC added (#572) by @saragerion
- build(deps): bump vm2 from 3.9.5 to 3.9.7 in /examples/cdk (#555) by @dependabot
- build(deps): bump vm2 from 3.9.5 to 3.9.7 in /packages/logger (#556) by @dependabot
This release was made possible by the following contributors:
@SH4DY, @AWSDB, @dreamorosi, @goverdhan07, @ijemmy and @saragerion