Commit Graph
2 Commits
Author SHA1 Message Date
Tom Myers 772467b7cc fix: tag rpc-v2-cbor timestamp lists so GetMetricData decodes (#1162)
* fix(cloudwatch): tag rpc-v2-cbor timestamp lists so GetMetricData decodes

GetMetricData responses encode MetricDataResults[].Timestamps as a list, but
the rpc-v2-cbor serializer only tagged scalar fields named "Timestamp". The
untagged list elements caused aws-sdk-go-v2 (and the OpenTelemetry Collector
awscloudwatch metrics receiver) to fail decoding with "unexpected value type
cbor.Uint".

Carry timestamp context into array elements and match timestamp members by
their "Timestamp"/"Timestamps" suffix, so every element of a timestamp list is
emitted as a CBOR tag(1) value (epoch seconds, RFC 8949 3.4.2) with integer-ness
preserved. Scalar timestamp handling is unchanged.

Tests:
- AwsJsonCborSerializerTest: asserts tag(1) bytes for scalar and list timestamps,
  integer preservation, and that non-timestamp numbers stay untagged.
- Go SDK compatibility suite: a GetMetricData case that exercises the real
  aws-sdk-go-v2 CBOR client end to end.

* apply copilot suggestions to tests
2026-06-06 08:37:34 -05:00
Conor Heine eeefb729c4 test: move compatibility tests into this repo (#225)
* test: move compatibility tests into this repo
* fix: add StatisticValues parsing to CloudWatchMetricsJsonHandler
* fix: add missing required abstract methods to EmulatorConfig in EventBridgeSchedulerIntegrationTest
* test: add sdk tests for multipart S3 copy coverage
* fix: cover and fix smithy cbor and multipart s3 copy regressions
* test: migrate more test coverage to new folder
* test: add missing ec2 expectation in healthcheck test
* docs: update READMEs in `./compatibility-tests`
2026-04-06 09:35:53 -05:00