-
Notifications
You must be signed in to change notification settings - Fork 165
Closed
Labels
bugSomething isn't workingSomething isn't workingcompletedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippedmetricsThis item relates to the Metrics UtilityThis item relates to the Metrics Utility
Description
Bug description
When constructing the middleware like:
middy(handler).use(logMetrics(metrics, { throwOnEmptyMetrics: false }));
... I would expect it to not throw an exception, but it does. It just doesn't on the value undefined
. It is slightly confusing...
Expected Behavior
Not throw exception.
Current Behavior
Throws exception
Possible Solution
Explicitly test for undefined
and false
.
Steps to Reproduce
- Setup via
middy(handler).use(logMetrics(metrics, { throwOnEmptyMetrics: false }));
- Do not emit metric
- Run handler
Environment
- Powertools version used: 1.2.1
- Packaging format (Layers, npm): npm
- AWS Lambda function runtime: nodejs.16x
- Debugging logs:
Related issues, RFCs
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcompletedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippedmetricsThis item relates to the Metrics UtilityThis item relates to the Metrics Utility