Repository: awslabs/aws-embedded-metrics-python

Issue:
MAX_DIMENSIONS should be 9, not 10
Per [the upstream docs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Embedded_Metric_Format_Specification.html#CloudWatch_Embedded_Metric_Format_Specification_structure_dimensionset):

> A DimensionSet MUST NOT contain more than 9 dimension keys.

Currently, you're setting `MAX_DIMENSIONS` to 10:

https://github.com/awslabs/aws-embedded-metrics-python/blob/658b2ebe829853a0ad53675d4b9d8917f7de18b7/aws_embedded_metrics/constants.py#L15

… and then using that to truncate the dimension set to 10 entries when serializing, e.g.:

https://github.com/awslabs/aws-embedded-metrics-python/blob/658b2ebe829853a0ad53675d4b9d8917f7de18b7/aws_embedded_metrics/serializers/log_serializer.py#L23-L30

I'm not sure that “silently truncating the dimension set” to an acceptable size is the best solution, but in any case the `MAX_DIMENSIONS` should be reduced to 9.

Discussion:

Patch:
diff --git a/aws_embedded_metrics/constants.py b/aws_embedded_metrics/constants.py
index ea53e7b..4fcdc5f 100644
--- a/aws_embedded_metrics/constants.py
+++ b/aws_embedded_metrics/constants.py
@@ -12,4 +12,4 @@
 # limitations under the License.
 
 DEFAULT_NAMESPACE = "aws-embedded-metrics"
-MAX_DIMENSIONS = 10
+MAX_DIMENSIONS = 9


Test patch:
diff --git a/tests/serializer/test_log_serializer.py b/tests/serializer/test_log_serializer.py
index bd58d35..2a7eedd 100644
--- a/tests/serializer/test_log_serializer.py
+++ b/tests/serializer/test_log_serializer.py
@@ -28,11 +28,11 @@ def test_serialize_dimensions():
     assert_json_equality(result_json, expected)
 
 
-def test_cannot_serialize_more_than_10_dimensions():
+def test_cannot_serialize_more_than_9_dimensions():
     # arrange
     dimensions = {}
     dimension_pointers = []
-    allowed_dimensions = 10
+    allowed_dimensions = 9
     dimensions_to_add = 15
 
     for i in range(0, dimensions_to_add):