awslabs/aws-embedded-metrics-python

Automatically flush for Log Event > 256KB

jchangxu opened this issue · 1 comments

According to https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Embedded_Metric_Format_Specification.html
The embedded metric format is subject to the same limits as standard CloudWatch Logs events and are limited to a maximum size of 256 KB.

It would be really nice to have an auto flush feature when we detect the serialized log event is near 256KB.

This one is interesting because we don’t know the size until we serialize it. We could maintain a character counter on insertion, but it may not be very accurate and will have lots of edge cases. Need to think about this one a bit. It might be easier to provide a configurable “flush after” metric count.