1

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

  • 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 '20 at 08:40

1 Answers1

3

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.

Alexander B
  • 146
  • 4
  • I wonder if there can be a lambda created that would push that data to cloudwatch easily. – Archimedes Trajano Oct 17 '20 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 https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/budgets-create.html#create-usage-budget for details – Alexander B Oct 19 '20 at 08:19