Feature request: populate middy's request.internal
with cleanup function for Metrics
#1535
Closed
1 of 2 tasks
Labels
completed
This item is complete and has been merged/shipped
feature-request
This item refers to a feature request for an existing or new utility
metrics
This item relates to the Metrics Utility
Use case
In the previous release we introduced a new shared function in the
commons
package that allows Middy middleware authors to call a cleanup function whenever their middleware has to return early. This allows other Powertools utilities that might be present in the Middleware stack to run their cleanup logic.In the case of Metrics this means flushing any stored metric to avoid delays in the reporting or potential (if unlikely) data loss.
Solution/User Experience
See PoC in the initial feature proposal.
Alternative solutions
No response
Acknowledgment
Future readers
Please react with 👍 and your use case to help us understand customer demand.
The text was updated successfully, but these errors were encountered: