Menu
Amazon Simple Storage Service
Developer Guide (API Version 2006-03-01)

Monitoring Metrics with Amazon CloudWatch

Amazon CloudWatch metrics for Amazon S3 can help you understand and improve the performance of applications that use Amazon S3. There are two ways that you can use CloudWatch with Amazon S3.

  • Daily Storage Metrics for Buckets ‐ You can monitor bucket storage using CloudWatch, which collects and processes storage data from Amazon S3 into readable, daily metrics. These storage metrics for Amazon S3 are reported once per day and are provided to all customers at no additional cost.

  • Request metrics ‐ You can choose to monitor Amazon S3 requests to quickly identify and act on operational issues. The metrics are available at 1 minute intervals after some latency to process. These CloudWatch metrics are billed at the standard rate. For information on CloudWatch pricing, see Amazon CloudWatch Pricing. To learn more about how to opt-in to getting these metrics, see Metrics Configurations for Buckets.

    When enabled, request metrics are reported for all object operations. By default, these 1-minute metrics are available at the Amazon S3 bucket level. You can also define a filter for the metrics collected –using a shared prefix or object tag– allowing you to align metrics filters to specific business applications, workflows, or internal organizations.

All CloudWatch statistics are retained for a period of fifteen months, so that you can access historical information and gain a better perspective on how your web application or service is performing. For more information on CloudWatch, see What Are Amazon CloudWatch, Amazon CloudWatch Events, and Amazon CloudWatch Logs? in the Amazon CloudWatch User Guide.

Metrics and Dimensions

The storage metrics and dimensions that Amazon S3 sends to CloudWatch are listed below.

Amazon S3 CloudWatch Daily Storage Metrics for Buckets

The AWS/S3 namespace includes the following daily storage metrics for buckets.

Metric Description
BucketSizeBytes

The amount of data in bytes stored in a bucket in the Standard storage class, Standard - Infrequent Access (Standard_IA) storage class, or the Reduced Redundancy Storage (RRS) class.

Valid storage type filters: StandardStorage, or StandardIAStorage, or ReducedRedundancyStorage (see StorageType dimension)

Units: Bytes

Valid statistics: Average

NumberOfObjects

The total number of objects stored in a bucket for all storage classes except for the GLACIER storage class.

Valid storage type filters: AllStorageTypes only (see StorageType dimension)

Units: Count

Valid statistics: Average

Amazon S3 CloudWatch Request metrics

The AWS/S3 namespace includes the following request metrics.

Metric Description
AllRequests

The total number of HTTP requests made to an Amazon S3 bucket, regardless of type. If you’re using a metrics configuration with a filter, then this metric only returns the HTTP requests made to the objects in the bucket that meet the filter's requirements.

Units: Count

Valid statistics: Sum

GetRequests

The number of HTTP GET requests made for objects in an Amazon S3 bucket. This doesn't include list operations.

Units: Count

Valid statistics: Sum

Note

Paginated list-oriented requests, like List Multipart Uploads, List Parts, Get Bucket Object versions, and others, are not included in this metric.

PutRequests

The number of HTTP PUT requests made for objects in an Amazon S3 bucket.

Units: Count

Valid statistics: Sum

DeleteRequests

The number of HTTP DELETE requests made for objects in an Amazon S3 bucket. This also includes Delete Multiple Objects requests. This metric shows the number of requests, not the number of objects deleted.

Units: Count

Valid statistics: Sum

HeadRequests

The number of HTTP HEAD requests made to an Amazon S3 bucket.

Units: Count

Valid statistics: Sum

PostRequests

The number of HTTP POST requests made to an Amazon S3 bucket.

Units: Count

Valid statistics: Sum

ListRequests

The number of HTTP requests that list the contents of a bucket.

Units: Count

Valid statistics: Sum

BytesDownloaded

The number bytes downloaded for requests made to an Amazon S3 bucket, where the response includes a body.

Units: Bytes

Valid statistics: Average (bytes per request), Sum (bytes per period), Sample Count, Min, Max

BytesUploaded

The number bytes uploaded that contain a request body, made to an Amazon S3 bucket.

Units: Bytes

Valid statistics: Average (bytes per request), Sum (bytes per period), Sample Count, Min, Max

4xxErrors

The number of HTTP 4xx client error status code requests made to an Amazon S3 bucket with a value of either 0 or 1. The average statistic shows the error rate, and the sum statistic shows the count of that type of error, during each period.

Units: Count

Valid statistics: Average (reports per request), Sum (reports per period), Min, Max, Sample Count

5xxErrors

The number of HTTP 5xx server error status code requests made to an Amazon S3 bucket with a value of either 0 or 1. The average statistic shows the error rate, and the sum statistic shows the count of that type of error, during each period.

Units: Counts

Valid statistics: Average (reports per request), Sum (reports per period), Min, Max, Sample Count

FirstByteLatency

The per-request time from the complete request being received by an Amazon S3 bucket to when the response starts to be returned.

Units: Milliseconds

Valid statistics: Average, Sum, Min, Max, Sample Count

TotalRequestLatency

The elapsed per-request time from the first byte received to the last byte sent to an Amazon S3 bucket. This includes the time taken to receive the request body and send the response body, which is not included in FirstByteLatency.

Units: Milliseconds

Valid statistics: Average, Sum, Min, Max, Sample Count

Amazon S3 CloudWatch Dimensions

The following dimensions are used to filter Amazon S3 metrics.

Dimension

Description

BucketName

This dimension filters the data you request for the identified bucket only.

StorageType

This dimension filters the data you have stored in a bucket by the type of storage. The types are StandardStorage for the Standard storage class, StandardIAStorage for the Standard_IA storage class, ReducedRedundancyStorage for the Reduced Redundancy Storage (RRS) class, and AllStorageTypes. The AllStorageTypes type includes the Standard, Standard_IA, and RRS storage classes, it does not include the GLACIER storage class.

FilterId

This dimension filters metrics configurations that you specify for request metrics on a bucket, for example, a prefix or a tag. You specify a filter id when you create a metrics configuration. For more information, see Metrics Configurations for Buckets.

Accessing CloudWatch Metrics

You can use the following procedures to view the storage metrics for Amazon S3. Note that the in order to get the Amazon S3 metrics involved, you must set a start and end timestamps. For metrics for any given 24-hour period, set the time period to 86400 seconds, the number of seconds in a day. Also, remember to set the BucketName and StorageType dimensions.

For example, if you use the AWS CLI to get the average of a specific bucket's size, in bytes, you could use the following command:

Copy
aws cloudwatch get-metric-statistics --metric-name BucketSizeBytes --namespace AWS/S3 --start-time 2016-10-19T00:00:00Z --end-time 2016-10-20T00:00:00Z --statistics Average --unit Bytes --region us-west-2 --dimensions Name=BucketName,Value=ExampleBucket Name=StorageType,Value=StandardStorage --period 86400 --output json

This example produces the following output:

Copy
{ "Datapoints": [ { "Timestamp": "2016-10-19T00:00:00Z", "Average": 1025328.0, "Unit": "Bytes" } ], "Label": "BucketSizeBytes" }

To view metrics using the CloudWatch console

  1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

  2. In the navigation pane, choose Metrics.

  3. Choose the S3 namespace.

  4. (Optional) To view a metric, type the metric name in the search field.

  5. (Optional) To filter by the StorageType dimension, type the name of the storage class in the search field.

To view a list of valid metrics stored for your AWS account using the AWS CLI

  • At a command prompt, use the following command:

    Copy
    aws cloudwatch list-metrics --namespace "AWS/S3"