Overview

It is useful to get notifications (dashboard alarms and email notifications) when S3 uploads fail (request metric). Or when your bucket exceeds a certain size (Storage metric).

The S3 Console

You can view S3 metrics either in the S3 console OR  the Cloudwatch console. I always prefer to start in the S3 console, as you can get granular and start with the bucket of choice.

Types of S3 metrics

S3 metrics fall into two broad categories - Storage metrics (bucket size, number of objects) and Request Metrics (failed writes, successful puts, deletes...)

s3 bucket metrics
s3_bucket_metrics

The Storage Metrics are free (5 minute interval updates). The Request Metrics are not free (1 minute updates).

Alarms (cloudwatch alarms) on Metrics

These are all created via the Cloudwatch console now (no longer available from the S3 console).

Cloudwatch --> Create Alarm --> Choose the metric  (the Request Metrics may take a while to appear..15 minutes from the time you add the metric to the graph)

Alarms on 404s and 500 Server Errors on a Bucket

404 errors and the 500s Errors (part of the Request Metrics) are the ones that are most often observed - and worth alerting/alarming on.

  • From the S3 console, select the bucket for which you would like to track metrics
  • From the Metrics tab on the bucket, --> View Additional Charts (see screenshot below...this is well concealed...). This will take you to the REQUEST metrics (as opposed to the default STORAGE metrics).
  • Manage Filters--> Create filter --> Choose Scope (All Objects in the bucket).
  • Once the filter is created, the metrics (the S3 request metrics) start showing up on the
  • Create a new alarm ---> New SNS Topic --> Email endpoint for the topic. Confirm (via email) your subscription to the topic
s3 request metrics
s3 request metrics
Pricing

10 Detailed Monitoring Metrics (at 1-minute frequency) are free

10 Alarm Metrics are free.

Summary 

It is extremely useful to be able to get an email notification, especially on upload errors on your S3 buckets. These errors manifest as 5XX errors or 4XX errors. This post describes how to create a custom alarm and SNS notification to an email endpoint for such events.

Need a hands on AWS DevOps Consultant?

Set up a 1 on 1 appointment with Anuj to assist with your cloud journey