-
Notifications
You must be signed in to change notification settings - Fork 634
Open
Labels
bugThis issue is a bug.This issue is a bug.p3This is a minor priority issueThis is a minor priority issue
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
client-cloudwatch MetricDatum interface says.
/**
* <p>The time the metric data was received, expressed as the number of milliseconds
* since Jan 1, 1970 00:00:00 UTC.</p>
* @public
*/
Timestamp?: Date | undefined;
This seems to be conflicting. The comment says it should take number of ms, but the type signature says it should take a Date object. API documentation confirms it's supposed to take ms since 1970: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html
I'd be happy if it could take either Date or ms as a number. But seems like it should at least take ms since that's what the API spec says.
Regression Issue
- Select this option if this issue appears to be a regression.
SDK version number
"@aws-sdk/client-cloudwatch": "^3.734.0",
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
22
Reproduction Steps
Pass a number in Timestamp field for PutMetricData
Observed Behavior
Fails
Expected Behavior
Timestamp property accepts ms since 1970
Possible Solution
Allow passing either a Date or number to the Timestamp property.
Additional Information/Context
No response
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.p3This is a minor priority issueThis is a minor priority issue