I am trying to monitor S3 folder level metrics, trying to get a comparison between two folders.
s3://logs-bucket/error/2019/01/
s3://logs-bucket/info/2019/01/
I spent an hour playing around with CloudWatch metrics but still have no idea how to do it. I am not trying to do anything fancy, just trying to graph NumberOfObjects
and BucketSizeBytes
between 2 folders. Is sub-level metrics a paid feature?
CloudWatch provides only bucket level metrics by default. But you can define additional metrics via filters (S3 bucket->Management->Metrics->Filters). Define new metric filter per each prefix (/error/2019/01/,/info/2019/01/
). Then you can use FilterId
as a dimension in the CloudWatch S3 query.
Doc: https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html
Update: @Tartaglia is right, filters are only for request metrics => you can't get NumberOfObjects and
BucketSizeByteswith
FilterId` dimension. So you can't use default CloudWatch functionality for your monitoring. You can script/code it and push requested metrics as a custom metrica to the CloudWatch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With