Conversation
sdangol
left a comment
There was a problem hiding this comment.
Thanks for the PR! I've added a few minor comments
…Record check Adds a unit test to ensure setDefaultDimensions logs a warning and returns early when passed a non-object value (e.g., a string), validating the runtime isRecord guard.
…turn on invalid input
sdangol
left a comment
There was a problem hiding this comment.
Thanks a lot for the contribution and for making the changes @uttam282005. Really appreciate it.
|
|
Great work @uttam282005! This will be included in today's release. |
|
Hi @uttam282005, we were trying to do a release today but our e2e tests were failing. We realized that there were duplicate logs being generated. This seems to be because of the |
|
Thanks for flagging this @sdangol, and apologies for the oversight. I’d be happy to work on a fix. |
|
Absolutely no need to apologise! This is why we have E2E tests because it's very hard to know how all the pieces in a module interact when you're working on a specific piece of the code base. |
…ws-powertools#4222) Co-authored-by: Swopnil Dangol <[email protected]>
…ws-powertools#4222) Co-authored-by: Swopnil Dangol <[email protected]>



Summary
Adds warning messages to the Metrics
setDefaultDimensionsmethod when overwriting existing default dimensions, ensuring consistency and parity withaddDimension/addDimensionsmethods.Changes
This pull request improves the robustness of the
setDefaultDimensionsmethod in the Metrics utility by:undefined,null, and invalid values for default dimensions.setDefaultDimensions()method in the Metrics utility to emit a warning when a default dimension is being overwritten.setDefaultDimensions(undefined)results in immediate return, with no warning emitted and only default dimensions applied.This PR addresses #4134 by improving input validation and error reporting for the
setDefaultDimensionsmethod in the Metrics module, to prevent invalid dimension names/values from being set.Issue number: #4134
Tests Added
The following tests were added:
setDefaultDimensions Update
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.