

# Monitoring Neptune Using Amazon CloudWatch
<a name="cloudwatch"></a>

Amazon Neptune and Amazon CloudWatch are integrated so that you can gather and analyze performance metrics. You can monitor these metrics using the CloudWatch console, the Amazon Command Line Interface (Amazon CLI), or the CloudWatch API.

CloudWatch also lets you set alarms so that you can be notified if a metric value breaches a threshold that you specify. You can even set up CloudWatch Events to take corrective action if a breach occurs. For more information about using CloudWatch and alarms, see the [CloudWatch Documentation](http://www.amazonaws.cn/documentation/cloudwatch).

**Topics**
+ [Viewing CloudWatch Data (Console)](#Console_Neptune)
+ [Viewing CloudWatch Data (Amazon CLI)](#CloudwatchCLI_Neptune)
+ [Viewing CloudWatch Data (API)](#CloudwatchAPI_Neptune)
+ [Using CloudWatch to monitor DB instance performance in Neptune](cloudwatch-monitoring-instances.md)
+ [Neptune CloudWatch Metrics](cw-metrics.md)
+ [Neptune CloudWatch Dimensions](cw-dimensions.md)

## Viewing CloudWatch Data (Console)
<a name="Console_Neptune"></a>

**To view CloudWatch data for a Neptune cluster (console)**

1. Sign in to the Amazon Web Services Management Console and open the CloudWatch console at [https://console.amazonaws.cn/cloudwatch/](https://console.amazonaws.cn/cloudwatch/).

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

1. In the **All Metrics** pane, choose **Neptune**, and then choose **DBClusterIdentifier**.

1. In the upper pane, scroll down to view the full list of metrics for your cluster. The available Neptune metric options appear in the **Viewing** list.

To select or deselect an individual metric, in the results pane, select the check box next to the resource name and metric. Graphs showing the metrics for the selected items appear at the bottom of the console. To learn more about CloudWatch graphs, see [Graph Metrics](https://docs.amazonaws.cn/AmazonCloudWatch/latest/DeveloperGuide/graph_metrics.html) in the *Amazon CloudWatch User Guide*.

## Viewing CloudWatch Data (Amazon CLI)
<a name="CloudwatchCLI_Neptune"></a>

**To view CloudWatch data for a Neptune cluster (Amazon CLI)**

1. Install the Amazon CLI. For instructions, see the [Amazon Command Line Interface User Guide](https://docs.amazonaws.cn/cli/latest/userguide/).

1. Use the Amazon CLI to fetch information. The relevant CloudWatch parameters for Neptune are listed in [Neptune CloudWatch Metrics](cw-metrics.md).

   The following example retrieves CloudWatch metrics for the number of Gremlin requests per second for the `gremlin-cluster` cluster.

   ```
   <![CDATA[
   aws cloudwatch get-metric-statistics \
       --namespace AWS/Neptune  --metric-name GremlinRequestsPerSec \
       --dimensions Name=DBClusterIdentifier,Value=gremlin-cluster \
       --start-time 2018-03-03T00:00:00Z --end-time 2018-03-04T00:00:00Z \
       --period 60 --statistics=Average
   ]]>
   ```

## Viewing CloudWatch Data (API)
<a name="CloudwatchAPI_Neptune"></a>

CloudWatch also supports a `Query` action so that you can request information programmatically. For more information, see the [CloudWatch Query API documentation](https://docs.amazonaws.cn/AmazonCloudWatch/latest/DeveloperGuide/Using_Query_API.html) and [Amazon CloudWatch API Reference](https://docs.amazonaws.cn/AmazonCloudWatch/latest/APIReference/).

When a CloudWatch action requires a parameter that is specific to Neptune monitoring, such as `MetricName`, use the values listed in [Neptune CloudWatch Metrics](cw-metrics.md).

The following example shows a low-level CloudWatch request, using the following parameters:
+ `Statistics.member.1` = `Average`
+ `Dimensions.member.1` = `DBClusterIdentifier=gremlin-cluster`
+ `Namespace ` = `AWS/Neptune`
+ `StartTime ` = `2013-11-14T00:00:00Z`
+ `EndTime ` = `2013-11-16T00:00:00Z`
+ `Period ` = `60`
+ `MetricName ` = `GremlinRequestsPerSec`

Here is what the CloudWatch request looks like. However, this is just to show the form of the request; you must construct your own request based on your metrics and timeframe.

```
 1. https://monitoring.amazonaws.com.cn/
 2.       ?SignatureVersion=2
 3.       &Action=GremlinRequestsPerSec
 4.       &Version=2010-08-01
 5.       &StartTime=2018-03-03T00:00:00
 6.       &EndTime=2018-03-04T00:00:00
 7.       &Period=60
 8.       &Statistics.member.1=Average
 9.       &Dimensions.member.1=DBClusterIdentifier=gremlin-cluster
10.       &Namespace=AWS/Neptune
11.       &MetricName=GremlinRequests
12.       &Timestamp=2018-03-04T17%3A48%3A21.746Z
13.       &AWSAccessKeyId=Amazon Access Key ID;
14.       &Signature=signature
```