-
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/shippedfeature-requestThis item refers to a feature request for an existing or new utilityThis item refers to a feature request for an existing or new utilitygood-first-issueSomething that is suitable for those who want to start contributingSomething that is suitable for those who want to start contributingmetricsThis item relates to the Metrics UtilityThis item relates to the Metrics Utility
Milestone
Description
Description of the feature request
Currently the metrics Class has a class propriety shouldRaiseOnEmptyMetrics
and middleware/decorator parameter raiseOnEmptyMetrics
that when set to true, will cause the library to throw an error when no metrics are created.
As flagged by @dreamorosi in this PR, throw
is a more intuitive and accurate way to describe the behaviour in the Node.js runtime.
The name is currently ported as it is from the Python library.
Problem statement
Based on above, the name of the parameters can be confusing for developers using the Node.js runtime.
Summary of the feature
- Rename both the middleware/decorator parameters, the class propriety and the types (from
raise
tothrow
) - Update the documentations and examples
Code examples
const handlerWithMiddleware = middy(lambdaHandler)
.use(logMetrics(metrics, { throwOnEmptyMetrics: true }));
Benefits for you and the wider AWS community
Better clarity of the feature, less confusion.
Describe alternatives you've considered
N/A
Additional context
Related issues, RFCs
Metadata
Metadata
Assignees
Labels
completedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippedfeature-requestThis item refers to a feature request for an existing or new utilityThis item refers to a feature request for an existing or new utilitygood-first-issueSomething that is suitable for those who want to start contributingSomething that is suitable for those who want to start contributingmetricsThis item relates to the Metrics UtilityThis item relates to the Metrics Utility