

# Monitor Lightsail bucket performance and usage
<a name="amazon-lightsail-viewing-bucket-metrics"></a>

After you create a bucket in the Amazon Lightsail object storage service, you can view its metric graphs on the **Metrics** tab of the bucket's management page. Monitoring metrics is an important part of maintaining the availability, and performance of your bucket. Monitor and collect metric data from your bucket regularly so that you can upsize or downsize the storage space and network transfer quota of your bucket when you need to. For more information about metrics, see [Resource metrics](amazon-lightsail-resource-health-metrics.md).

When monitoring your resources, you should establish a baseline for normal resource performance in your environment. Then you can configure alarms in the Lightsail console to notify you when your resources are performing outside of specified thresholds. For more information, see [Notifications](amazon-lightsail-notifications.md) and [Alarms](amazon-lightsail-alarms.md).

## Bucket metrics
<a name="bucket-metrics-available"></a>

The following bucket metrics are available:
+ **Bucket size** — The amount of data stored in a bucket. This value is calculated by summing the size of all objects in the bucket (both current and noncurrent objects), including the size of all parts for all incomplete multipart uploads to the bucket.
+ **Number of objects** — The total number of objects stored in a bucket. This value is calculated by counting all objects in the bucket (both current and noncurrent objects) and the total number of parts for all incomplete multipart uploads to the bucket.

**Note**  
Bucket metric data is not reported when your bucket is empty.

## View bucket metrics in the Lightsail console
<a name="view-bucket-metrics"></a>

Complete the following procedure to view bucket metrics in the Lightsail console.

1. Sign in to the [Lightsail console](https://lightsail.aws.amazon.com/).

1. In the left navigation pane, choose **Storage**.

1. Choose the name of the bucket for which you want to view metrics.

1. Choose the **Metrics** tab on the bucket management page.

1. Choose the metric that you want to view in the dropdown menu under the **Metrics graphs** heading.

   The graph displays a visual representation of the data points for the chosen metric.

   *ScreenshotTBD*

   You can perform the following actions on the metrics graph:
   + Change the view of the graph to show data for 1 hour, 6 hours, 1 day, 1 week, and 2 weeks.
   + Pause your cursor on a data point to view detailed information about that data point.
   + Add an alarm for the chosen metric to be notified when the metric crosses a threshold you specify. For more information, see [Alarms](amazon-lightsail-alarms.md) and [Create bucket metric alarms](amazon-lightsail-adding-bucket-metric-alarms.md).

## Manage buckets and objects
<a name="viewing-metrics-managing-buckets-and-objects"></a>

These are the general steps to manage your Lightsail object storage bucket:

1. Learn about objects and buckets in the Amazon Lightsail object storage service. For more information, see [Object storage in Amazon Lightsail](buckets-in-amazon-lightsail.md).

1. Learn about the names that you can give your buckets in Amazon Lightsail. For more information, see [Bucket naming rules in Amazon Lightsail](bucket-naming-rules-in-amazon-lightsail.md).

1. Get started with the Lightsail object storage service by creating a bucket. For more information, see [Creating buckets in Amazon Lightsail](amazon-lightsail-creating-buckets.md).

1. Learn about security best practices for buckets and the access permissions that you can configure for your bucket. You can make all objects in your bucket public or private, or you can choose to make individual objects public. You can also grant access to your bucket by creating access keys, attaching instances to your bucket, and granting access to other AWS accounts. For more information, see [Security Best Practices for Amazon Lightsail object storage](amazon-lightsail-bucket-security-best-practices.md) and [Understanding bucket permissions in Amazon Lightsail](amazon-lightsail-understanding-bucket-permissions.md).

   After learning about bucket access permissions, see the following guides to grant access to your bucket:
   + [Block public access for buckets in Amazon Lightsail](amazon-lightsail-block-public-access-for-buckets.md)
   + [Configuring bucket access permissions in Amazon Lightsail](amazon-lightsail-configuring-bucket-permissions.md)
   + [Configuring access permissions for individual objects in a bucket in Amazon Lightsail](amazon-lightsail-configuring-individual-object-access.md)
   + [Creating access keys for a bucket in Amazon Lightsail](amazon-lightsail-creating-bucket-access-keys.md)
   + [Configuring resource access for a bucket in Amazon Lightsail](amazon-lightsail-configuring-bucket-resource-access.md)
   + [Configuring cross-account access for a bucket in Amazon Lightsail](amazon-lightsail-configuring-bucket-cross-account-access.md)

1. Learn how to enable access logging for your bucket, and how to use access logs to audit the security of your bucket. For more information, see the following guides.
   + [Access logging for buckets in the Amazon Lightsail object storage service](amazon-lightsail-bucket-access-logs.md)
   + [Access log format for a bucket in the Amazon Lightsail object storage service](amazon-lightsail-bucket-access-log-format.md)
   + [Enabling access logging for a bucket in the Amazon Lightsail object storage service](amazon-lightsail-enabling-bucket-access-logs.md)
   + [Using access logs for a bucket in Amazon Lightsail to identify requests](amazon-lightsail-using-bucket-access-logs.md)

1. Create an IAM policy that grants a user the ability to manage a bucket in Lightsail. For more information, see [IAM policy to manage buckets in Amazon Lightsail](amazon-lightsail-bucket-management-policies.md).

1. Learn about the way that objects in your bucket are labeled and identified. For more information, see [Understanding object key names in Amazon Lightsail](understanding-bucket-object-key-names-in-amazon-lightsail.md).

1. Learn how to upload files and manage objects in your buckets. For more information, see the following guides.
   + [Uploading files to a bucket in Amazon Lightsail](amazon-lightsail-uploading-files-to-a-bucket.md)
   + [Uploading files to a bucket in Amazon Lightsail using multipart upload](amazon-lightsail-uploading-files-to-a-bucket-using-multipart-upload.md)
   + [Viewing objects in a bucket in Amazon Lightsail](amazon-lightsail-viewing-objects-in-a-bucket.md)
   + [Copying or moving objects in a bucket in Amazon Lightsail](amazon-lightsail-copying-moving-bucket-objects.md)
   + [Downloading objects from a bucket in Amazon Lightsail](amazon-lightsail-downloading-bucket-objects.md)
   + [Filtering objects in a bucket in Amazon Lightsail](amazon-lightsail-filtering-bucket-objects.md)
   + [Tagging objects in a bucket in Amazon Lightsail](amazon-lightsail-tagging-bucket-objects.md)
   + [Deleting objects in a bucket in Amazon Lightsail](amazon-lightsail-deleting-bucket-objects.md)

1. Enable object versioning to preserve, retrieve, and restore every version of every object stored in your bucket. For more information, see [Enabling and suspending object versioning in a bucket in Amazon Lightsail](amazon-lightsail-managing-bucket-object-versioning.md).

1. After enabling object versioning, you can restore previous versions of objects in your bucket. For more information, see [Restoring previous versions of objects in a bucket in Amazon Lightsail](amazon-lightsail-restoring-bucket-object-versions.md).

1. Monitor the utilization of your bucket. For more information, see [Viewing metrics for your bucket in Amazon Lightsail](#amazon-lightsail-viewing-bucket-metrics).

1. Configure an alarm for bucket metrics to be notified when the utilization of your bucket crosses a threshold. For more information, see [Creating bucket metric alarms in Amazon Lightsail](amazon-lightsail-adding-bucket-metric-alarms.md).

1. Change the storage plan of your bucket if it's running low on storage and network transfer. For more information, see [Changing the plan of your bucket in Amazon Lightsail](amazon-lightsail-changing-bucket-plans.md).

1. Learn how to connect your bucket to other resources. For more information, see the following tutorials.
   + [Tutorial: Connecting a WordPress instance to an Amazon Lightsail bucket](amazon-lightsail-connecting-buckets-to-wordpress.md)
   + [Tutorial: Using an Amazon Lightsail bucket with a Lightsail content delivery network distribution](amazon-lightsail-using-distributions-with-buckets.md)

1. Delete your bucket if you're no longer using it. For more information, see [Deleting buckets in Amazon Lightsail](amazon-lightsail-deleting-buckets.md).

**Topics**
+ [Bucket metrics](#bucket-metrics-available)
+ [View bucket metrics in the Lightsail console](#view-bucket-metrics)
+ [Manage buckets and objects](#viewing-metrics-managing-buckets-and-objects)
+ [Create alarms](amazon-lightsail-adding-bucket-metric-alarms.md)

# Monitor Lightsail bucket storage with metric alarms
<a name="amazon-lightsail-adding-bucket-metric-alarms"></a>

You can create an Amazon Lightsail alarm that watches a single bucket metric. An alarm can be configured to notify you based on the value of the metric relative to a threshold that you specify. Notifications can be a banner displayed in the Lightsail console, an email sent to your email address, and an SMS text message sent to your mobile phone number. For more information about alarms, see [Alarms](amazon-lightsail-alarms.md).

**Contents**
+ [Bucket alarm limits](#bucket-alarm-limits)
+ [Best practices for configuring bucket alarms](#bucket-alarms-best-practices)
+ [Default alarm settings](#default-bucket-alarm-settings)
+ [Create bucket metric alarms using the Lightsail console](#creating-bucket-alarms)
+ [Test bucket metric alarms using the Lightsail console](#testing-bucket-alarms)
+ [Next steps after creating bucket alarms](#next-steps-creating-bucket-alarms)

## Bucket alarm limits
<a name="bucket-alarm-limits"></a>

The following limits apply to alarms:
+ You can configure two alarms per metric.
+ Alarms are evaluated in 5 minute intervals, and each data point for alarms represents a 5 minute period of aggregated metric data.
+ You can only configure an alarm to notify you when the alarm state changes to `OK` if you configure the alarm to notify you by email and/or SMS text message.
+ You can only test the `OK` alarm notification if you configure the alarm to notify you by email and/or SMS text message.
+ You can only configure an alarm to notify you when the alarm state changes to `INSUFFICIENT_DATA` if you configure the alarm to notify you by email and/or SMS text message, and if you choose the **Do not evaluate the missing data** option for missing data points.
+ You can only test notifications if the alarm is in an OK state.

## Best practices for configuring bucket alarms
<a name="bucket-alarms-best-practices"></a>

Before you configure a metric alarm for your bucket, you should determine what you want to be notified about. For example, with the **Bucket size** metric in mind, you might want to be notified when your bucket is almost full. If your bucket current plan includes a 5 GB of storage space, then you might want to configure an alarm for the **Bucket size** metric when it reaches 4.5 GB. Then you should be notified with sufficient time to upsize your bucket's plan.

## Default alarm settings
<a name="default-bucket-alarm-settings"></a>

Default alarm settings are pre-populated when you add a new alarm in the Lightsail console. That is the recommended alarm configuration for the metric you selected. However, you should confirm that the default alarm configuration is appropriate for your resource. For example, the default alarm threshold for the bucket size bytes metric is **greater than or equal to** 75 GB. However, that request threshold might be too high for your bucket if it's configured to have only 5 GB of storage space. You might want to modify the alarm threshold to be **equal to or greater than** 4.5 GB.

## Create bucket metric alarms using the Lightsail console
<a name="creating-bucket-alarms"></a>

Complete the following steps to create a bucket metric alarm using the Lightsail console.

1. Sign in to the [Lightsail console](https://lightsail.aws.amazon.com/).

1. In the left navigation pane, choose **Storage**.

1. Choose the name of the bucket for which you want to create alarms.

1. Choose the **Metrics** tab on the bucket management page.

1. Choose the metric for which you want to create an alarm in the drop-down menu under the **Metrics Graphs** heading. For more information, see [Resource metrics](amazon-lightsail-resource-health-metrics.md).

1. Choose **Add alarm** in the **Alarms** section of the page.

1. Choose a comparison operator value in the drop-down menu. Example values are greater than or equal to, greater than, less than, or less than or equal to.

1. Enter a threshold for the alarm.

1. Enter the data points to alarm.

1. Choose the evaluation periods. The period can be specified in 5-minute increments, from 5 minutes up to 24 hours.

1. Choose one of the following notification methods:
   + **Email** — You are notified by email when the alarm state changes to ALARM.
   + **SMS text message** — You are notified by SMS text message when the alarm state changes to ALARM. SMS messaging is not supported in all AWS Regions, and SMS text messages cannot be sent to all countries/regions. For more information, see [SMS text messaging support](amazon-lightsail-adding-editing-notification-contacts.md#sms-support).
**Note**  
You are required to add an email address or mobile phone number if you select to be notified by email or SMS but you haven’t yet configured a notification contact in the resource’s AWS Region. For more information, see [Notifications](amazon-lightsail-notifications.md).

1. (Optional) Choose **Send me a notification when the alarm state change to OK** to be notified when the alarm state changes to OK. This option is available only if you choose to be notified by Email or SMS text message.

1. (Optional) Choose **Advanced settings**, and then choose one of the following options:
   + Choose how the alarm should treat missing data The following options are available:
     + **Assume it's not within the threshold (Breaching threshold)** — Missing data points are treated as "bad" and breaching the threshold.
     + **Assume it's within the threshold (Not breaching threshold)** — Missing data points are treated as "good" and within the threshold.
     + **Use the value of the last good data point (Ignore and maintain the current alarm state)** — The current alarm state is maintained.
     + **Do not evaluate it (Treat missing data as missing)** — The alarm doesn't consider missing data points when evaluating whether to change state.
   + Choose **Send a notification if there is insufficient data** to be notified when the alarm state changes to INSUFFICIENT\$1DATA. This option is available only if you choose to be notified by Email or SMS text message.

1. Choose **Create** to add the alarm.

   To edit the alarm later, choose the ellipsis icon (⋮) next to the alarm you want to edit, and choose **Edit alarm**.

## Test bucket metric alarms using the Lightsail console
<a name="testing-bucket-alarms"></a>

Complete the following steps to test an alarm using the Lightsail console. You might want to test an alarm to confirm that the configured notification options are working, such as to ensure that you receive an email or an SMS text message when the alarm is triggered.

1. Sign in to the [Lightsail console](https://lightsail.aws.amazon.com/).

1. In the left navigation pane, choose **Storage**.

1. Choose the name of the bucket for which you want to test an alarm.

1. Choose the **Metrics** tab on the bucket management page.

1. Choose the metric for which you want to test an alarm in the drop-down menu under the **Metrics Graphs** heading.

1. Scroll down to the **Alarms** section of the page, and choose the ellipsis icon (⋮) next to the alarm you want to test.

1. Choose one of the following options:
   + **Test alarm notification** — Choose this option to test the notifications for when the alarm state changes to `ALARM`.
   + **Test OK notification** — Choose this option to test the notifications for when the alarm state changes to `OK`.
**Note**  
If either of these options is unavailable, you might not have configured the notification options for the alarm, or the alarm might currently be in an `ALARM` state. For more information, see [Bucket alarm limits](#bucket-alarm-limits).

   The alarm momentarily changes to an `ALARM` or `OK` state depending on the test option you chose, and an email and/or SMS text message is sent depending on what you configured as the notification method for the alarm. A notification banner displays in the Lightsail console only if you chose to test the `ALARM` notification. A notification banner is not displayed if you chose to test the `OK` notification. The alarm will return to its actual state often after a few seconds.

## Next steps after creating bucket alarms
<a name="next-steps-creating-bucket-alarms"></a>

There are a few additional tasks that you can perform for your bucket alarms:
+ To stop receiving notifications, you can remove your email and mobile phone from Lightsail. For more information, see [Delete notification contacts](amazon-lightsail-deleting-notification-contacts.md). You can also disable or delete an alarm to stop receiving notifications for a specific alarm. For more information, see [Delete or disable metric alarms](amazon-lightsail-deleting-health-metric-alarms.md).