

# Monitor Amazon IoT SiteWise with Amazon CloudWatch metrics
<a name="monitor-cloudwatch-metrics"></a>

You can monitor Amazon IoT SiteWise using CloudWatch, which collects raw data and processes it into readable, near real-time metrics. These statistics are kept for 15 months, so that you can access historical information and gain a better perspective on how your web application or service is performing. You can also set alarms that watch for certain thresholds, and send notifications or take actions when those thresholds are met. For more information, see the [Amazon CloudWatch User Guide](https://docs.amazonaws.cn/AmazonCloudWatch/latest/monitoring/).

Amazon IoT SiteWise publishes the metrics and dimensions listed in the sections below to the `AWS/IoTSiteWise` namespace.

**Tip**  
Amazon IoT SiteWise publishes metrics on a one minute interval. When you view these metrics in graphs in the CloudWatch console, we recommend that you choose a **Period** of **1 minute**. This lets you see the highest available resolution of your metric data.

**Topics**
+ [Amazon IoT Greengrass Version 2 gateway metrics](#gateway-metrics-ggv2)

## Amazon IoT Greengrass Version 2 gateway metrics
<a name="gateway-metrics-ggv2"></a>

Amazon IoT SiteWise publishes gateway metrics for Classic streams, V2 gateways and MQTT-enabled, V3 gateways. Unless otherwise indicated, each metric is applicable to both self-hosted gateway versions. All SiteWise Edge gateway metrics are published on a one minute interval.


**SiteWise Edge gateway metrics**  

| Metric | Description | 
| --- | --- | 
| Gateway.AvailableMemory | The available memory of a SiteWise Edge gateway.<br />Unit: Bytes<br />Dimension: None | 
| Gateway.AvailableDiskSpace | The available disk space of a SiteWise Edge gateway.<br />Unit: Bytes<br />Dimension: None | 
| Gateway.CloudConnectivity | The cloud connectivity status of a SiteWise Edge gateway.<br />Unit: None<br />Dimension: GatewayId | 
| Gateway.CpuUsage | The CPU usage of a SiteWise Edge gateway.<br />Unit: Percentage<br />Dimension: None | 
| Gateway.TotalDiskSpace | The total disk space of a SiteWise Edge gateway.<br />Unit: Bytes<br />Dimension: None | 
| Gateway.TotalMemory | The total memory of a SiteWise Edge gateway.<br />Unit: Bytes<br />Dimension: None | 
| Gateway.UsedDiskSpace | The used disk space of a SiteWise Edge gateway.<br />Unit: Bytes<br />Dimension: None | 
| Gateway.UsedMemory | The used memory of a SiteWise Edge gateway.<br />Unit: Bytes<br />Dimension: None | 
| Gateway.UsedPercentageDiskSpace | The used percentage of disk space of a SiteWise Edge gateway.<br />Unit: Bytes<br />Dimension: None | 
| Gateway.UsedPercentageMemory | The used percentage memory of a SiteWise Edge gateway.<br />Unit: Bytes<br />Dimension: None | 


**Amazon IoT SiteWise publisher metrics**  

| Metric | Description | 
| --- | --- | 
| IoTSiteWisePublisher.ComponentBuildVersion | This metric indicates the build version of the IoT SiteWise publisher component running on the gateway. A value of 1 signifies that the gateway is running a version of the publisher corresponding to the `ComponentBuildVersion` dimension.<br />Unit: 1<br />Dimensions: GatewayId, ComponentBuildVersion | 
| IoTSiteWisePublisher.DroppedCount | The number of data points that are dropped by a SiteWise Edge gateway (`GatewayId`) and not published to the cloud, generated every minute.<br />Unit: Count<br />Dimensions: GatewayId | 
| IoTSiteWisePublisher.Heartbeat | Generated every minute by the Publisher in the SiteWise Edge gateway.<br />Unit: 1 (1 representing the Publisher is running and missing the data point representing the Publisher is not running.)<br />Dimensions: GatewayId | 
| IoTSiteWisePublisher.IsConnectedToMqttBroker | Generated every minute by the Publisher in the SiteWise Edge gateway.<br />Unit: 1 (1 representing the Publisher is connected to a MQTT broker.)<br />Dimensions: GatewayId | 
| IoTSiteWisePublisher.MessageCheckpointPersistenceErrorCount | The metric indicates that the gateway has detected an issue with the checkpoint file used to track data processed by the publisher. A value of `1` signifies that a failure has occurred.<br />Unit: None<br />Dimensions: AccountId, GatewayId | 
| IoTSiteWisePublisher.MqttMessageReceivedSuccessCount | The number of messages successfully received by the Publisher from the MQTT broker, generated every minute.<br />Unit: Count<br />Dimensions: GatewayId | 
| IoTSiteWisePublisher.MqttReceivedSuccessBytes | The number of bytes of message data successfully received by the Publisher from the MQTT broker, generated every minute.<br />Unit: Count<br />Dimensions: GatewayId | 
| IoTSiteWisePublisher.NumberOfSubscriptionsToMqttBroker | The number of topics subscribed to the MQTT broker by the Publisher, generated every minute. A multilevel wild card topic is counted as 1.<br />Unit: Count<br />Dimensions: GatewayId | 
| IoTSiteWisePublisher.NumberOfUniqueMqttTopicsReceived | The number of unique topics received by the Publisher from the MQTT broker, generated every minute.<br />Unit: Count<br />Dimensions: GatewayId | 
| IoTSiteWisePublisher.PublishFailureCount | The number of data points that a SiteWise Edge gateway (`GatewayId`) failed to publish, generated every minute.<br />Unit: Count<br />Dimensions: GatewayId | 
| IoTSiteWisePublisher.PublishRejectedCount | The number of data points that a SiteWise Edge gateway (`GatewayId`) rejected from the cloud side, generated every minute.<br />Unit: Count<br />Dimensions: GatewayId | 
| IoTSiteWisePublisher.PublishSuccessCount | The number of data points that a SiteWise Edge gateway (`GatewayId`) successfully published to the cloud, generated every minute.<br />Unit: Count<br />Dimensions: GatewayId | 
| IoTSiteWisePublisher.PublishToS3FailureCount | The number of data points that a gateway (`GatewayId`) failed to publish to an Amazon S3 bucket.<br />Unit: Count<br />Dimensions: GatewayId | 
| IoTSiteWisePublisher.PublishToS3SuccessCount | The number of data points that a gateway (`GatewayId`) successfully published to an Amazon S3 bucket.<br />Unit: Count<br />Dimensions: GatewayId | 


**OPC UA collector metrics**  

| Metric | Description | 
| --- | --- | 
| OpcUaCollector.ActiveDataStreamCount | The number of data streams that a SiteWise Edge gateway (`gatewayId`) subscribed to for an OPC UA source (`sourceName`).<br />Unit: Count<br />Dimensions: GatewayId, SourceName, PropertyGroup | 
| OpcUaCollector.ComponentBuildVersion (not available on Classic streams, V2 gateways) | This metric indicates the build version of the IoT SiteWise OPC UA collector component running on the gateway. A value of 1 signifies that the gateway is running a version of the collector corresponding to the `ComponentBuildVersion` dimension.<br />Unit: 1<br />Dimensions: GatewayId, ComponentBuildVersion | 
| OpcUaCollector.ConversionErrors | The number of data points that a SiteWise Edge gateway (`gatewayId`) received for an OPC UA source (`sourceName`) which resulted in conversion errors while sending the data to Amazon IoT SiteWise. These data points will not be ingested by OPC UA Collector.<br />Unit: Count<br />Dimensions: GatewayId, SourceName | 
| OpcUaCollector.Heartbeat | Generated every minute for each OPC UA source (`sourceName`) connected to a SiteWise Edge gateway (`gatewayId`).<br />Unit: Count (1 representing the source is connected and 0 representing the source is disconnected.)<br />Dimensions: GatewayId, SourceName | 
| OpcUaCollector.IncomingValuesCount | The number of data points that a SiteWise Edge gateway (`gatewayId`) received for an OPC UA source (`sourceName`), generated every minute.<br />Unit: Count<br />Dimensions: GatewayId, SourceName, PropertyGroup | 
| OpcUaCollector.IncomingValueErrors |  The number of data points that a SiteWise Edge gateway (`gatewayId`) receives from an OPC UA source (`sourceName`) that are not valid values. These data points are not ingested by the OPC UA Collector, generated every minute.<br />Unit: Count<br />Dimensions: GatewayId, SourceName, PropertyGroup | 
| OpcUaCollector.IsConnectedToMqttBroker (not available on Classic streams, V2 gateways) | Generated every minute by the IoT SiteWise OPC UA collector component in the SiteWise Edge gateway.<br />Unit: 1 (1 representing the IoT SiteWise OPC UA collector component is connected to an MQTT broker)<br />Dimensions: GatewayId | 
| OpcUaCollector.MqttMessagesDroppedCount (not available on Classic streams, V2 gateways) | The number of MQTT messages dropped by the IoT SiteWise OPC UA collector component. <br />Unit: Count<br />Dimensions: GatewayId, SourceName | 
| OpcUaCollector.MqttMessagesPublishedBytes (not available on Classic streams, V2 gateways) | The number of bytes of MQTT message data successfully published by the IoT SiteWise OPC UA collector component to the MQTT broker.<br />Unit: Count<br />Dimensions: GatewayId, SourceName | 
| OpcUaCollector.MqttMessagesPublishedCount (not available on Classic streams, V2 gateways) | The number of MQTT messages successfully published by the IoT SiteWise OPC UA collector component to the MQTT broker.<br />Unit: Count<br />Dimensions: GatewayId, SourceName | 
| OpcUaCollector.NullValueCount (not available on Classic streams, V2 gateways) | The number of null values received by the IoT SiteWise OPC UA collector component from the OPC UA server.<br />Unit: Count<br />Dimensions: GatewayId, SourceName, PropertyGroup | 
| OpcUaCollector.NumberOfUniqueMqttTopicsPublished (not available on Classic streams, V2 gateways) | The number of unique MQTT topics published by the IoT SiteWise OPC UA collector to the MQTT broker.<br />Unit: Count<br />Dimensions: GatewayId, SourceName | 


**Amazon IoT SiteWise processor metrics**  

| Metric | Description | 
| --- | --- | 
| Gateway.DataProcessor.IngestionThrottled (not available on MQTT-enabled, V3 gateways) | The number of data points that were throttled, generated every minute.<br />Unit: Count<br />Dimensions: ThrottledAt | 
| Gateway.DataProcessor.MeasurementRejected (not available on MQTT-enabled, V3 gateways) | The number of measurements that were rejected, generated every minute.<br />Unit: Count<br />Dimensions: Reason | 
| Gateway.DataProcessor.MessagesRemaining (not available on MQTT-enabled, V3 gateways) | The number of messages remaining in a stream, generated every minute.<br />Unit: Count<br />Dimensions: StreamName | 
| Gateway.DataProcessor.ProcessingError (not available on MQTT-enabled, V3 gateways) | The number of processing errors, generated every minute.<br />Unit: Count<br />Dimensions: Reason | 