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?
Asked
Active
Viewed 6,032 times
2
-
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
2 Answers
4
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
- 156
- 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
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

Tim
- 31,888
- 7
- 52
- 78