fix: PutMetricData Timestamp should be a Date #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📚 Context/Description Behind The Change
In version 1.3.3,
cloudwatch-metrics
is throwing when using the option{withTimestamp: true}
.The AWS SDK specifies that Timestamp should be of Date type per MetricDatum spec. In version
[email protected]
is sending a string instead.Sources:
https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-cloudwatch/src/models/models_0.ts#L4491-L4496
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch/Interface/PutMetricDataCommandInput/
Error when using
[email protected]
.To reproduce error and test the fix:
🚨 Potential Risks & What To Monitor After Deployment
None
🧑🔬 How Has This Been Tested?
[email protected]
in my product codebase causes it to throw. The proposed change, when linked or patched in mynode_modules
, fixes the issue.🚚 Release Plan
Bump version to 1.3.4 and publish npm package.