Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS S3 monitor folder level metrics

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?

like image 311
moon Avatar asked Oct 16 '22 07:10

moon


1 Answers

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 andBucketSizeByteswithFilterId` 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.

like image 129
Jan Garaj Avatar answered Oct 19 '22 02:10

Jan Garaj