At first I was sending my metric like this:
aws cloudwatch put-metric-data --metric-name testMetricName --namespace test --unit Bytes --value $(( val += RANDOM % 1001 - 500)) --dimensions Server=AAA,Region=BBB
I stopped that and changed the unit:
aws cloudwatch put-metric-data --metric-name testMetricName --namespace test --unit Gigabytes --value $(( val += RANDOM % 1001 - 500)) --dimensions Server=AAA,Region=BBB
The metric still appears on the same graph, nothing seems to have changed. I thought cloudwatch aggregates metrics by the unit and this was supposed to create a new metric:
Metric data points that specify a unit of measure are aggregated separately. When you get statistics without specifying a unit, CloudWatch aggregates all data points of the same unit together. If you have two otherwise identical metrics with different units, two separate data streams are returned, one for each unit.