3

I want to track and alert if my logs go awry. But I can't find a way of tracking the stored bytes for a log group. Is it possible to even add that as a metric?

enter image description here

1
  • I looked at this recently - my conclusion was that there was no easy way to get the size of a log group.
    – Tim
    Oct 17, 2020 at 8:40

2 Answers 2

5

The supported Metrics for CloudWatch log groups that might suit your use case are IncomingBytes and IncomingLogEvents for event ingestion.

If you want to monitor event forwarding to your subscribers as well there are metrics available too.

See full documentation on supported metrics: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Monitoring-CloudWatch-Metrics.html

The actual log group size seems to only be available via API decribe-log-groups.

2
  • I wonder if there can be a lambda created that would push that data to cloudwatch easily. Oct 17, 2020 at 18:28
  • A alternative but rather hacky way without a lot of implementation effort could be to set up a budget alert for this log group for the Usage type (in this case "CloudWatch > Region-TimedStoarage-byteHrs (GB/Month)") and filter on a custom cost tag that identifies your log group you are interested in. However this won't let you get the metric in CloudWatch but only via E-mail or SNS Topic. See docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/… for details Oct 19, 2020 at 8:19
0

This newer answer is very useful. AWS Support told "smk081"

Stored Bytes/Stored GB do not update in real time. There is a delay of at least 24 hours on average but it can vary some.

Also

IncomingBytes is the raw, uncompressed bytes while the Stored Bytes is compressed

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .