-
Notifications
You must be signed in to change notification settings - Fork 161
Closed
Labels
completedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippedinternalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)loggerThis item relates to the Logger UtilityThis item relates to the Logger UtilitymetricsThis item relates to the Metrics UtilityThis item relates to the Metrics UtilitytracerThis item relates to the Tracer UtilityThis item relates to the Tracer Utility
Milestone
Description
Description of the feature request
The execution of this issue should be divided into 3 steps:
- Vet the business logic of Logger, Tracer and Metrics utilities to identify code de-duplication opportunities. Opportunities found so far: cold-start business logic, fetching of environment variables.
- Add that logic in commons.
- Remove duplicated logic from the single utilities, in favour of the logic from the commons package.
Problem statement
Right now there is a number of functionalities that are repeated throughout the 3 different utilities, all with their own business logic and separated unit tests.
This is not optimal because:
- The same feature should have the same behaviour across all utilities
- This unnecessarily increases the cost of maintenance
- Code duplication inflates the libraries's size unnecessarily, with impact over the Lambda package size and consequently cold-starts
Summary of the feature
See above.
Code examples
Benefits for you and the wider AWS community
Describe alternatives you've considered
Additional context
See here:
https://github.com/awslabs/aws-lambda-powertools-typescript/blob/main/packages/logger/src/config/EnvironmentVariablesService.ts
https://github.com/awslabs/aws-lambda-powertools-typescript/blob/main/packages/logger/src/Logger.ts#L92
Related issues, RFCs
N/A
dreamorosi and michaelbrewer
Metadata
Metadata
Assignees
Labels
completedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippedinternalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)loggerThis item relates to the Logger UtilityThis item relates to the Logger UtilitymetricsThis item relates to the Metrics UtilityThis item relates to the Metrics UtilitytracerThis item relates to the Tracer UtilityThis item relates to the Tracer Utility