-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(logger): adopted Utility class & updated unit tests #550
feat(logger): adopted Utility class & updated unit tests #550
Conversation
d4b93be
to
aaecc99
Compare
…com:awslabs/aws-lambda-powertools-typescript into feat/logger/adopt_utility_common_cold_start
This PR also includes changes to |
@@ -44,6 +44,8 @@ For a **complete list** of supported environment variables, refer to [this secti | |||
|
|||
#### Example using AWS Serverless Application Model (SAM) | |||
|
|||
The `Logger` utility is instantiated outside of the Lambda handler. In doing this, the same instance can be used across multiple invocations inside the same execution environment. This allows `Metrics` to be aware of things like whether or not a given invocation had a cold start or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this paragraph!
Suggestion #1 (minor): I understand what we are trying to achieve with this paragraph, but I don't know if it's entirely clear what is the advantage of reusing the instance on multiple invocation here. The Metrics reference can also be confusing since the Logger has the cold start logic too.
Suggestion #2 (minor): I'd move this text outside of the SAM section as this does not relate to SAM specifically. Maybe it can be formatted as inline block to make it more visible?
https://squidfunk.github.io/mkdocs-material/reference/admonitions/?h=warning#inline-blocks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes total sense, I'll open a separate PR after this one is merged as the same "notice" appears also in Tracer
& Metrics
which have already been merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, added 2 minor comments
* build(deps-dev): bump esbuild from 0.14.x to 0.14.23 * feat(logger): adopted Utility class & updated unit tests (#550) * feat: adopted Utility class & updated unit tests * docs: added notice in docs * WIP * build: added commons dependency * deps: fixed lock * rebuilt lock after rebase * chore: update commented * set explicit packages order * amend lock * run with older * removed commons from workspace * build: added foreground-scripts flag to CI * fix: issue with workflows * fix: lock file * build(deps-dev): bump esbuild from 0.14.x to 0.14.23
Description of your changes
This PR introduces changes to the
Logger
module to adopt the forthcomingUtility
class that will be released in the@aws-lambda-powertools/commons
package.@aws-lambda-powertools/commons
packageUtility
classHow to verify this change
See results of PR checks, also see the screenshot below that shows a successful e2e test run (on local):
WIP
Optionally, re-run the e2e tests on GitHub Actions
Related issues, RFCs
#484
#547
PR status
Is this ready for review?: NO
Is it a breaking change?: NO
Checklist
Breaking change checklist
N/A
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.