Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible Regression with CloudWatch Timestamps in v1.34.9 #3498

Closed
3 tasks done
Sutto opened this issue Aug 20, 2020 · 4 comments · Fixed by #3507 or #3512
Closed
3 tasks done

Possible Regression with CloudWatch Timestamps in v1.34.9 #3498

Sutto opened this issue Aug 20, 2020 · 4 comments · Fixed by #3507 or #3512
Labels
bug This issue is a bug.

Comments

@Sutto
Copy link

Sutto commented Aug 20, 2020

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug

The latest release (and I suspect #3489) is causing a regression with all code that uses the cloudwatch SDK for us. We just went from 1.34.7 to 1.34.9, and in code that posts custom metrics started receiving exceptions such as:

MalformedInput: timestamp must follow ISO8601

We aren't serializing times, instead passing aws.Time(time.Now()), and the only change was to bump our SDK version as above.

Version of AWS SDK for Go?

v1.34.9

Version of Go (go version)?

1.13.6

To Reproduce (observed behavior)

  • Construct cloudwatch.MetricDatum with timestamp of aws.Time(time.Now())
  • Post to cloudwatch using PutMetricData

(I unfortunately don't have a full code sample as my go is rusty, but can get one if it helps)

Expected behavior

It to continue to work as it previously did, especially since we're not explicitly constructing ISO8601 times?

Additional context

I'm assuming there is possibly a difference in the level of granularity supported for ISO8601 timestamp (hence the above PR being the possible cause?).

@Sutto Sutto added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 20, 2020
@niebloomj
Copy link

I believe i am experiencing the same issue. My scripts have stopped working.

@saraogivinay
Copy link

Same here

@diehlaws diehlaws removed the needs-triage This issue or PR still needs to be triaged. label Aug 22, 2020
@diehlaws
Copy link
Contributor

Thanks @Sutto for bringing this to our attention and thanks @niebloomj and @saraogivinay for confirming this. I'm able to reproduce the described behavior, we'll work on fixing this shortly. In the meantime as a temporary workaround you can reformat time.Now as shown below to continue using this version of the SDK.

t, _ := time.Parse(time.RFC3339, time.Now().Format(time.RFC3339))

input := &cloudwatch.PutMetricDataInput{
  MetricData: []*cloudwatch.MetricDatum{
    {
      MetricName: aws.String("go-3498"),
      Timestamp:  aws.Time(t),
      Value:      aws.Float64(0.50),
      Unit:       aws.String("Count"),
    },
  },
  Namespace: aws.String("go-3498"),
}

@jasdel
Copy link
Contributor

jasdel commented Aug 26, 2020

You can also simplify this with Time.Truncate, and avoid the Parse and Format.

input := &cloudwatch.PutMetricDataInput{
  MetricData: []*cloudwatch.MetricDatum{
    {
      MetricName: aws.String("go-3498"),
      Timestamp:  aws.Time(t.Truncate(time.Second)),
      Value:      aws.Float64(0.50),
      Unit:       aws.String("Count"),
    },
  },
  Namespace: aws.String("go-3498"),
}

aws-sdk-go-automation pushed a commit that referenced this issue Aug 28, 2020
===

### Service Client Updates
* `service/cloudfront`: Updates service API and documentation
  * You can now manage CloudFront's additional, real-time metrics with the CloudFront API.
* `service/cur`: Updates service API and documentation
  * This release add MONTHLY as the new supported TimeUnit for ReportDefinition.
* `service/elasticmapreduce`: Updates service API, documentation, and paginators
  * Amazon EMR adds support for ICMP, port -1, in Block Public Access Exceptions and API access for EMR Notebooks execution. You can now non-interactively execute EMR Notebooks and pass input parameters.
* `service/route53`: Updates service documentation
  * Documentation updates for Route 53

### SDK Bugs
*  `private/protocol`: Limit iso8601 fractional second precision to milliseconds ([#3507](#3507))
  * Fixes [#3498](#3498)
aws-sdk-go-automation added a commit that referenced this issue Aug 28, 2020
Release v1.34.13 (2020-08-28)
===

### Service Client Updates
* `service/cloudfront`: Updates service API and documentation
  * You can now manage CloudFront's additional, real-time metrics with the CloudFront API.
* `service/cur`: Updates service API and documentation
  * This release add MONTHLY as the new supported TimeUnit for ReportDefinition.
* `service/elasticmapreduce`: Updates service API, documentation, and paginators
  * Amazon EMR adds support for ICMP, port -1, in Block Public Access Exceptions and API access for EMR Notebooks execution. You can now non-interactively execute EMR Notebooks and pass input parameters.
* `service/route53`: Updates service documentation
  * Documentation updates for Route 53

### SDK Bugs
*  `private/protocol`: Limit iso8601 fractional second precision to milliseconds ([#3507](#3507))
  * Fixes [#3498](#3498)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
5 participants