

# Graphing metrics
<a name="graph_metrics"></a>

Use the CloudWatch console to graph metric data generated by other AWS services. This makes it more efficient to see the metric activity on your services. The following procedures describe how to graph metrics in CloudWatch.

**Topics**
+ [Graph a metric](graph_a_metric.md)
+ [Merge two graphs into one](merge_graphs.md)
+ [Use dynamic labels](graph-dynamic-labels.md)
+ [Modify the time range or time zone format for a graph](modify_graph_date_time.md)
+ [Zoom in on a line graph or stacked area graph](zoom-graph.md)
+ [Modify the y-axis for a graph](switch_graph_axes.md)
+ [Create an alarm from a metric on a graph](create_alarm_metric_graph.md)

# Graph a metric
<a name="graph_a_metric"></a>

You can select metrics and create graphs of the metric data using the CloudWatch console.

CloudWatch supports the following statistics on metrics: `Average`, `Minimum`, `Maximum`, `Sum`, and `SampleCount`. For more information, see [Statistics](cloudwatch_concepts.md#Statistic).

You can view your data at different levels of detail. For example, you can choose a one-minute view, which can be useful when troubleshooting. Or, choose a less detailed, one-hour view. That can be useful when viewing a broader time range (for example, 3 days) so that you can see trends over time. For more information, see [Periods](cloudwatch_concepts.md#CloudWatchPeriods).

If you are using an account that is set up as a monitoring account in CloudWatch cross-account observability, you can graph metrics from the source accounts linked to this monitoring account. For more information, see [CloudWatch cross-account observability](CloudWatch-Unified-Cross-Account.md).

## Creating a graph
<a name="create-metric-graph"></a>

**To graph a metric**

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1. In the navigation pane, choose **Metrics**, **All metrics**.

1. In the **Browse** tab, enter a search term in the search field, such as a metric name, account ID, or resource name.

   For example, if you search for the `CPUUtilization` metric, you see the namespaces and dimensions with this metric.

1. Select one of the results for your search to view the metrics.

1. To graph one or more metrics, select the check box next to each metric. To select all metrics, select the check box in the heading row of the table.

1. (Optional) To change the type of graph, choose the **Options** tab. You can then choose between a line graph, stacked area chart, number display, gauge, bar chart, or pie chart.

1. Choose the **Graphed metrics** tab.

1. (Optional) To change the statistic used in the graph, choose the new statistic in the **Statistic** column next to the metric name.

   For more information about CloudWatch statistics, see [CloudWatch statistics definitions](Statistics-definitions.md). For more information about the **p*xx* percentile statistics, see [Percentiles](cloudwatch_concepts.md#Percentiles).**

1. (Optional) To add an anomaly detection band that shows expected values for the metric, choose the anomaly detection icon under **Actions** next to the metric. For more information about anomaly detection, see [Using CloudWatch anomaly detection](CloudWatch_Anomaly_Detection.md).   
![\[The metrics console, with the anomaly detection icon circled.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/Anomaly_Detection_Icon.PNG)

   CloudWatch uses up to two weeks of the metric's recent historical data to calculate a model for expected values. It then displays this range of expected values as a band on the graph. CloudWatch adds a new row under the metric to display the anomaly detection band math expression, labeled **ANOMALY\$1DETECTION\$1BAND**. If recent historical data exists, you immediately see a preview anomaly detection band, which is an approximation of the anomaly detection band generated by the model. It takes up to 15 minutes for the actual anomaly detection band to appear.

   By default, CloudWatch creates the upper and lower bounds of the band of expected values with a default value of 2 for the band threshold. To change this number, change the value at the end of the formula under **Details** for the band.

   1. (Optional) Choose **Edit model** to change how the anomaly detection model is calculated. You can exclude past and future time periods from being used in the training for calculating the model. It is critical to exclude unusual events system as system outage, deployments, and holidays from the training data. You can also specify the time zone to use for the model for daylight saving time changes.

     For more information, see [Editing an anomaly detection model](Create_Anomaly_Detection_Alarm.md#Modify_Anomaly_Detection_Model).

   For more information about anomaly detection, see [Using CloudWatch anomaly detection](CloudWatch_Anomaly_Detection.md).

   To hide the model from the graph, remove the check mark from the line with the ` ANOMALY_DETECTION_BAND` function or choose the `X` icon. To delete the model entirely, choose **Edit model**, **Delete model**.

1. (Optional) As you choose metrics to graph, specify a dynamic label to appear on the graph legend for each metric. Dynamic labels display a statistic about the metric, and automatically update when the dashboard or graph is refreshed. To add a dynamic label, choose **Graphed metrics**, **Add dynamic label**.

   By default, the dynamic values that you add to the label appear at the beginning of the label. You can then choose the **Label** value for the metric to edit the label. For more information, see [Use dynamic labels](graph-dynamic-labels.md).

1. To view more information about the metric being graphed, pause the mouse over the legend.

1. Horizontal annotations can help graph users more efficiently see when a metric has spiked to a certain level, or whether the metric is within a predefined range. To add a horizontal annotation, choose the **Options** tab and then **Add horizontal annotation**:

   1. For **Label**, enter a label for the annotation.

   1. For **Value**, enter the metric value where the horizontal annotation appears.

   1. For **Fill**, specify whether to use fill shading with this annotation. For example, choose `Above` or `Below` for the corresponding area to be filled. If you specify `Between`, another `Value` field appears, and the area of the graph between the two values is filled.

   1. For **Axis**, specify whether the numbers in `Value` refer to the metric associated with the left Y-axis or the right Y-axis, if the graph includes multiple metrics.

      You can change the fill color of an annotation by choosing the color square in the left column of the annotation. 

   Repeat these steps to add multiple horizontal annotations to the same graph.

   To hide an annotation, clear the check box in the left column for that annotation.

   To delete an annotation, choose **x** in the **Actions** column.

1. To get a URL for your graph, choose **Actions**, **Share**. Copy the URL to save or share.

1. To add your graph to a dashboard, choose **Actions**, **Add to dashboard**.

## Creating a graph of metrics from another data source
<a name="create-metric-graph-multidatasource"></a>

You can create a graph that displays resources from data sources other than CloudWatch. For more information about creating connections to these other data sources, see [Query metrics from other data sources](MultiDataSourceQuerying.md).

**To graph a metric from another data source**

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1. In the navigation pane, choose **Metrics**, **All metrics**.

1. Choose the **Multi source query** tab.

1. For **Data source**, select the data source that you want to use.

   If you haven't already created a connection to the data source that you want, select **Create and manage data sources**, then choose **Create and manage data sources**. For information about the rest of this data source creation process, see [Connect to a prebuilt data source with a wizard](CloudWatch_MultiDataSources-Connect.md).

1. The wizard or query editor prompts you for the information necessary for the query. The workflow is different for each data source, and is tailored to the data source. For example, for Amazon Managed Service for Prometheus; and Prometheus data sources, a PromQL query editor box with a query helper appear.

1. When you have finished constructing the query, choose **Graph query**.

   The graph is populated with metrics from the query.

1. (Optional) Horizontal annotations can help graph users more efficiently see when a metric has spiked to a certain level, or whether the metric is within a predefined range. To add a horizontal annotation, choose the **Options** tab and then **Add horizontal annotation**:

   1. For **Label**, enter a label for the annotation.

   1. For **Value**, enter the metric value where the horizontal annotation appears.

   1. For **Fill**, specify whether to use fill shading with this annotation. For example, choose `Above` or `Below` for the corresponding area to be filled. If you specify `Between`, another `Value` field appears, and the area of the graph between the two values is filled.

   1. For **Axis**, specify whether the numbers in `Value` refer to the metric associated with the left Y-axis or the right Y-axis, if the graph includes multiple metrics.

      You can change the fill color of an annotation by choosing the color square in the left column of the annotation. 

   Repeat these steps to add multiple horizontal annotations to the same graph.

   To hide an annotation, clear the check box in the left column for that annotation.

   To delete an annotation, choose **x** in the **Actions** column.

1. (Optional) To add this graph to a dashboard, choose **Actions**, **Add to dashboard**.

## Updating a graph
<a name="update-metric-graph"></a>

**To update your graph**

1. To change the name of the graph, choose the pencil icon.

1. To change the time range, select one of the predefined values or choose **custom**. For more information, see [Modify the time range or time zone format for a graph](modify_graph_date_time.md).

1. To change the statistic, choose the **Graphed metrics** tab. Choose the column heading or an individual value and then choose one of the statistics or predefined percentiles, or specify a custom percentile (for example, **p95.45**).

1. To change the period, choose the **Graphed metrics** tab. Choose the column heading or an individual value and then choose a different value.

1. To add a horizontal annotation, choose **Graph options** and then **Add horizontal annotation**:

   1. For **Label**, enter a label for the annotation.

   1. For **Value**, enter the metric value where the horizontal annotation appears.

   1. For **Fill**, specify whether to use fill shading with this annotation. For example, choose `Above` or `Below` for the corresponding area to be filled. If you specify `Between`, another `Value` field appears, and the area of the graph between the two values is filled.

   1. For **Axis**, specify whether the numbers in `Value` refer to the metric associated with the left y-axis or the right y-axis, if the graph includes multiple metrics.

      You can change the fill color of an annotation by choosing the color square in the left column of the annotation. 

   Repeat these steps to add multiple horizontal annotations to the same graph.

   To hide an annotation, clear the check box in the left column for that annotation.

   To delete an annotation, choose **x** in the **Actions** column.

1. To change the refresh interval, choose **Refresh options** and then select **Auto refresh** or choose **1 Minute**, **2 Minutes**, **5 Minutes**, or **15 Minutes**.

## Duplicating a metric
<a name="duplicate-metric-graph"></a>

**To duplicate a metric**

1. Choose the **Graphed metrics** tab.

1. For **Actions**, choose the **Duplicate** icon.  
![\[Duplicate a metric\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/metric_graph_duplicate.png)

1. Update the duplicate metric as needed.

# Merge two graphs into one
<a name="merge_graphs"></a>

You can merge two different graphs into one, and then the resulting graph shows both metrics. This can be useful if you already have different metrics displayed in different graphs and want to combine them, or you want to easily create a single graph with metrics from different Regions.

To merge a graph into another one, you use either the URL or JSON source of the graph that you want to merge in.

**To merge two graphs into one**

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1. Open the graph that you want to merge into another graph. To do so, you can choose **Metrics**, **All metrics**, and then choose a metric to graph. Or you can open a dashboard and then open one of the graphs on the dashboard by selecting the graph and choosing **Open in metrics** from the menu at the upper right of the graph. 

1. After you have a graph open, do one of the following:.
   + Copy the URL from the browser bar.
   + Choose the **Source** tab and then choose **Copy**.

1. Open the graph that you want to merge the previous graph into. 

1. When you have the second graph open in the **Metrics** view, choose **Actions**, **Merge graph**.

1. Enter the URL or JSON that you previously copied, and choose **Merge**.

1. The merged graphs appear. The y-axis on the left is for the original graph, and the y-axis on the right is for the graph that you merged into it.
**Note**  
If the graph that you merged into uses the **METRICS()** function, the metrics in the graph that was merged in are not included in the **METRICS()** calculation in the merged graph.

1. To save the merged graph to a dashboard, choose **Actions**, **Add to dashboard**.

# Use dynamic labels
<a name="graph-dynamic-labels"></a>

You can use dynamic labels with your graphs. Dynamic labels add a dynamically updated value to the label for the selected metric. You can add a wide range of values to the labels, as shown in the following tables.

The dynamic value shown in the label is derived from the time range currently shown on the graph. The dynamic part of the label automatically updates when either the dashboard or the graph is refreshed. 

If you use a dynamic label with a search expression, the dynamic label applies to every metric returned by the search. 

You can use the CloudWatch console to add a dynamic value to a label, edit the label, change the position of the dynamic value within the label column, and make other customizations.

## Dynamic labels
<a name="dynamic-label-syntax"></a>

Within a dynamic label, you can use the following values relating to properties of the metric:


| Dynamic label live value | Description | 
| --- | --- | 
|  \$1\$1AVG\$1 |  The average of the values in the time range currently shown in the graph.  | 
|  \$1\$1DATAPOINT\$1COUNT\$1 |  The number of data points in the time range that is currently shown in the graph.  | 
|  \$1\$1FIRST\$1 |  The oldest of the metric values in the time range that is currently shown in the graph.  | 
|  \$1\$1FIRST\$1LAST\$1RANGE\$1 |  The difference between the metric values of the oldest and newest data points that are currently shown in the graph.  | 
|  \$1\$1FIRST\$1LAST\$1TIME\$1RANGE\$1 |  The absolute time range between the oldest and newest data points that are currently shown in the graph.  | 
|  \$1\$1FIRST\$1TIME\$1 |  The timestamp of the oldest data point in the time range that is currently shown in the graph.  | 
|  \$1\$1FIRST\$1TIME\$1RELATIVE\$1 |  The absolute time difference between now and the timestamp of the oldest data point in the time range that is currently shown in the graph.  | 
|  \$1\$1LABEL\$1 |  The representation of the default label for a metric.  | 
|  \$1\$1LAST\$1 |  The most recent of the metric values in the time range that is currently shown in the graph.  | 
|  \$1\$1LAST\$1TIME\$1 |  The timestamp of the newest data point in the time range that is currently shown in the graph.  | 
|  \$1\$1LAST\$1TIME\$1RELATIVE\$1 |  The absolute time difference between now and the timestamp of the newest data point in the time range that is currently shown in the graph.  | 
|  \$1\$1MAX\$1 |  The maximum of the values in the time range currently shown in the graph.  | 
|  \$1\$1MAX\$1TIME\$1 |  The timestamp of the data point that has the highest metric value, of the data points that are currently shown in the graph.  | 
|  \$1\$1MAX\$1TIME\$1RELATIVE\$1 |  The absolute time difference between now and the timestamp of the data point with the highest value, of those data points that are currently shown in the graph.  | 
|  \$1\$1MIN\$1 |  The minimum of the values in the time range currently shown in the graph.  | 
|  \$1\$1MIN\$1MAX\$1RANGE\$1 |  The difference in metric values between the data points with the highest and lowest metric values, of those data points that are currently shown in the graph.  | 
|  \$1\$1MIN\$1MAX\$1TIME\$1RANGE\$1 |  The absolute time range between the data points with the highest and lowest metric values, of those data points that are currently shown in the graph.  | 
|  \$1\$1MIN\$1TIME\$1 |  The timestamp of the data point that has the lowest metric value, of the data points that are currently shown in the graph.  | 
|  \$1\$1MIN\$1TIME\$1RELATIVE\$1 |  The absolute time difference between now and the timestamp of the data point with the lowest value, of those data points that are currently shown in the graph.  | 
|  \$1\$1PROP('AccountId')\$1 |  The AWS account ID of the metric.  | 
|  \$1\$1PROP('AccountLabel')\$1 |  The label specified for the source account that owns this metric, in CloudWatch cross-account observability.  | 
|  \$1\$1PROP('Dim.*dimension\$1name*')\$1 |  The value of the specified dimension. Replace *dimension\$1name* with the case-sensitive name of your dimension.  | 
|  \$1\$1PROP('MetricName')\$1 |  The name of the metric.  | 
|  \$1\$1PROP('Namespace')\$1 |  The namespace of the metric.  | 
|  \$1\$1PROP('Period')\$1 |  The period of the metric, in seconds.  | 
|  \$1\$1PROP('Region')\$1 |  The AWS Region where the metric is published.  | 
|  \$1\$1PROP('Stat')\$1 |  The metric statistic that is being graphed.  | 
|  \$1\$1SUM\$1 |  The sum of the values in the time range currently shown in the graph.  | 

For example, suppose you have a search expression **SEARCH(' \$1AWS/Lambda, FunctionName\$1 Errors ', 'Sum')**, which finds the `Errors` for each of your Lambda functions. If you set the label to be `[max: ${MAX} Errors for Function Name ${LABEL}]`, the label for each metric is **[max: *number* Errors for Function Name *Name*]**.

You can add as many as six dynamic values to a label. You can use the `${LABEL}` placeholder only once within each label.

# Modify the time range or time zone format for a graph
<a name="modify_graph_date_time"></a>

 This section describes how you can modify the date, time, and time zone format on a CloudWatch metrics graph. It also describes how you can zoom in on a graph to apply a specific time range. For information about creating a graph, see [Graph a metric](graph_a_metric.md). 

**Note**  
If the time range of a dashboard is shorter than the period used for a graph on the dashboard, the following happens:  
 The graph is modified to display the amount of data corresponding one complete period for that widget, even though this is longer than the dashboard time range. This ensures that there is at least one data point on the graph. 
 The start time of the period for this data point is adjusted backwards to ensure that at least one data point can be displayed.

## Set a relative time range
<a name="set-relative-time-range"></a>

------
#### [  New interface  ]

**To specify a relative time range for a graph**

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1.  In the navigation pane, choose **Metrics**, and then choose **All metrics**. In the upper right corner of the screen, you can select one of the predefined time ranges, which span from 1 hour to 1 week (**1h**, **3h**, **12h**, **1d**, **3d**, or **1w**). Alternatively, you can choose **Custom** to set your own time range. 

1.  Choose **Custom**, and then select the **Relative** tab in the upper left corner of the box. You can specify a time range in **Minutes**, **Hours**, **Days**, **Weeks**, **Months**. 

1.  After you specify a time range, choose **Apply**. 

------
#### [  Original interface  ]

**To specify a relative time range for a graph**

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1.  In the navigation pane, choose **Metrics**, and then choose **All metrics**. In the upper right corner of the screen, you can select one of the predefined time ranges, which span from 1 hour to 1 week (**1h**, **3h**, **12h**, **1d**, **3d**, or **1w**). Alternatively, you can choose **custom** to set your own time range. 

1.  Choose **custom**, and then choose **Relative** in the upper left corner of the box. You can specify a time range in **Minutes**, **Hours**, **Days**, **Weeks**, or **Months**.

------

## Set an absolute time range
<a name="set-absolute-time-range"></a>

------
#### [  New interface  ]

**To specify an absolute time range for a graph**

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1.  In the navigation pane, choose **Metrics**, and then choose **All metrics**. In the upper right corner of the screen, you can select one of the predefined time ranges, which span from 1 hour to 1 week (**1h**, **3h**, **12h**, **1d**, **3d**, or **1w**). Alternatively, you can choose **Custom** to set your own time range. 

1.  Choose **Custom**, and then select the **Absolute** tab in the upper left corner of the box. Use the calendar picker or text field boxes to specify a time range. 

1.  After you specify a time range, choose **Apply**. 

------
#### [  Original interface  ]

**To specify an absolute time range for a graph**

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1.  In the navigation pane, choose **Metrics**, and then choose **All metrics**. In the upper right corner of the screen, you can select one of the predefined time ranges, which span from 1 hour to 1 week (**1h**, **3h**, **12h**, **1d**, **3d**, or **1w**). Alternatively, you can choose **custom** to set your own time range. 

1.  Choose **custom**, and then choose **Absolute** in the upper left corner of the box. Use the calendar picker or text field boxes to specify a time range. 

1.  After you specify a time range, choose **Apply**. 

------

## Set the time zone format
<a name="set-time-zone-Cloudwatch-graph"></a>

------
#### [  New interface  ]

**To specify the time zone for a graph**

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1.  In the navigation pane, choose **Metrics**, and then choose **All metrics**. In the upper right corner of the screen, you can select one of the predefined time ranges, which span from 1 hour to 1 week (**1h**, **3h**, **12h**, **1d**, **3d**, or **1w**). Alternatively, you can choose **Custom** to set your own time range. 

1.  Choose **Custom**, and then choose the dropdown in the upper right corner of the box. You can change the time zone to **UTC** or **Local time zone**. 

1.  After you make your changes, choose **Apply**. 

------
#### [  Original interface  ]

**To specify the time zone for a graph**

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1.  In the navigation pane, choose **Metrics**, and then choose **All metrics**. In the upper right corner of the screen, you can select one of the predefined time ranges, which span from 1 hour to 1 week (**1h**, **3h**, **12h**, **1d**, **3d**, or **1w**). Alternatively, you can choose **custom** to set your own time range. 

1.  Choose **custom**, and then choose the dropdown in the upper right corner of the box. You can change the time zone to **UTC** or **Local timezone**. 

------

# Zoom in on a line graph or stacked area graph
<a name="zoom-graph"></a>

 In the CloudWatch console, you can use the mini-map zoom feature to focus on sections of line graphs and stacked area graphs without changing between zoomed-in and zoomed-out views. For example, you can use the mini-map zoom feature to focus on a peak in a line graph, so that you can compare the spike against other metrics in your dashboard from the same timeline. The procedures in this section describe how to use the zoom feature. 

![\[A screenshot of the zoom feature that shows comparisons.\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/widget_zoom.png)


 In the preceding image, the zoom feature focuses on a spike in a line graph that's related to the input bytes processing rate while also showing other line graphs in the dashboard that focus on sections from the same timeline. 

------
#### [  New interface  ]

**To zoom in on a graph**

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1.  In the navigation pane, choose **Metrics**, and then choose **All metrics**. 

1.  Choose **Browse**, and then select a metric or metrics to graph. 

1.  Choose **Options**, and select **Line** under ***Widget type***. 

1.  Choose and drag on the area of the graph that you want to focus on, and then release the drag. 

1.  To reset the zoom, choose the **Reset zoom** icon, which looks like a magnifying glass with a minus (-) symbol inside. 

------
#### [  Original interface  ]

**To zoom in on a graph**

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1.  In the navigation pane, choose **Metrics**, and then choose **All metrics**. . 

1.  Choose **All metrics**, and then select a metric to graph. 

1.  Choose **Graph options**. Under ***Widget type*** select **Line**. 

1.  Choose and drag on the area of the graph that you want to focus on, and then release the drag. 

1.  To reset the zoom, choose the **Reset zoom** icon, which looks like a magnifying glass with a minus (-) symbol inside. 

------

**Tip**  
 If you already created a dashboard that contains a line graph or stacked area graph, you can go to the dashboard and begin using the zoom feature. 

# Modify the y-axis for a graph
<a name="switch_graph_axes"></a>

You can set custom bounds for the y-axis on a graph to help you see the data better. For example, you can change the bounds on a `CPUUtilization` graph to 100 percent so that it's easy to see whether the CPU is low (the plotted line is near the bottom of the graph) or high (the plotted line is near the top of the graph).

You can switch between two different y-axes for your graph. This is useful if the graph contains metrics that have different units or that differ greatly in their range of values.

**To modify the y-axis on a graph**

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1. In the navigation pane, choose **Metrics**, **All metrics**.

1. Select a metric namespace (for example, **EC2**) and then a metric dimension (for example, **Per-Instance Metrics**).

1. The **All metrics** tab displays all metrics for that dimension in that namespace. To graph a metric, select the check box next to the metric.

1. On the **Graph options** tab, specify the **Min** and **Max** values for **Left Y Axis**. The value of **Min** can't be greater than the value of **Max**.  
![\[Set custom bounds for the y-axis\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/metric_graph_custom_bounds.png)

1. To create a second y-axis, specify the **Min** and **Max** values for **Right Y Axis**.

1. To switch between the two y-axes, choose the **Graphed metrics** tab. For **Y Axis**, choose **Left Y Axis** or **Right Y Axis**.  
![\[Switch between the y-axes for a graph\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/metric_graph_switch_axis.png)

# Create an alarm from a metric on a graph
<a name="create_alarm_metric_graph"></a>

You can graph a metric and then create an alarm from the metric on the graph, which has the benefit of populating many of the alarm fields for you.

**To create an alarm from a metric on a graph**

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1. In the navigation pane, choose **Metrics**, **All metrics**.

1. Select a metric namespace (for example, **EC2**) and then a metric dimension (for example, **Per-Instance Metrics**).

1. The **All metrics** tab displays all metrics for that dimension in that namespace. To graph a metric, select the check box next to the metric.

1. To create an alarm for the metric, choose the **Graphed metrics** tab. For **Actions**, choose the alarm icon.  
![\[Create an alarm from a graphed metric\]](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/images/metric_graph_alarm.png)

1. Under **Conditions**, choose **Static** or **Anomaly detection** to specify whether to use a static threshold or anomaly detection model for the alarm.

   Depending on your choice, enter the rest of the data for the alarm conditions.

1. Choose **Additional configuration**. For **Datapoints to alarm**, specify how many evaluation periods (data points) must be in the `ALARM` state to trigger the alarm. If the two values here match, you create an alarm that goes to `ALARM` state if that many consecutive periods are breaching.

   To create an M out of N alarm, specify a lower number for the first value than you specify for the second value. For more information, see [Alarm evaluation](alarm-evaluation.md).

1. For **Missing data treatment**, choose how to have the alarm behave when some data points are missing. For more information, see [Configuring how CloudWatch alarms treat missing data](alarms-and-missing-data.md).

1. Choose **Next**.

1. Under **Notification**, select an SNS topic to notify when the alarm is in `ALARM` state, `OK` state, or `INSUFFICIENT_DATA` state.

   To have the alarm send multiple notifications for the same alarm state or for different alarm states, choose **Add notification**.

   To have the alarm not send notifications, choose **Remove**.

1. To have the alarm perform Auto Scaling or EC2 actions, choose the appropriate button and choose the alarm state and action to perform.

1. When finished, choose **Next**.

1. Enter a name and description for the alarm. The name must contain only ASCII characters. Then choose **Next**.

1. Under **Preview and create**, confirm that the information and conditions are what you want, then choose **Create alarm**.