

# Proxy metrics

ELB for Envoy publishes data points to CloudWatch for your proxies. CloudWatch lets you retrieve those data points as an ordered set of time-series data, known as metrics. You use metrics to confirm that a proxy is performing as you expect.

You can create a CloudWatch alarm that watches a single metric. The alarm can send a notification or take an action when the metric crosses a threshold that you set.

A proxy reports metrics to CloudWatch only when requests are flowing through the proxy. CloudWatch reports no metrics for a period in which there is no data to report.

The following table lists the metrics that a proxy publishes to CloudWatch, with the most meaningful statistic for each metric.


<table>
<thead>
  <tr><th>Metric</th><th>Description</th><th>Statistic</th></tr>
</thead>
<tbody>
  <tr><td colspan="3"><b>Requests</b></td></tr>
  <tr><td><code>RequestCount</code></td><td>The number of requests the proxy completed. Omits connections reset before any response was sent.</td><td>Sum</td></tr>
  <tr><td colspan="3"><b>Response codes returned to clients (downstream)</b></td></tr>
  <tr><td><code>HTTPCode_Downstream_2XX_Count</code></td><td>The number of HTTP 2XX responses returned to clients, including responses the proxy generated.</td><td>Sum</td></tr>
  <tr><td><code>HTTPCode_Downstream_3XX_Count</code></td><td>The number of HTTP 3XX responses returned to clients, including responses the proxy generated.</td><td>Sum</td></tr>
  <tr><td><code>HTTPCode_Downstream_4XX_Count</code></td><td>The number of HTTP 4XX responses returned to clients, including responses the proxy generated.</td><td>Sum</td></tr>
  <tr><td><code>HTTPCode_Downstream_5XX_Count</code></td><td>The number of HTTP 5XX responses returned to clients, including responses the proxy generated.</td><td>Sum</td></tr>
  <tr><td colspan="3"><b>Response codes from targets (upstream)</b></td></tr>
  <tr><td><code>HTTPCode_Upstream_2XX_Count</code></td><td>The number of HTTP 2XX responses generated by targets.</td><td>Sum</td></tr>
  <tr><td><code>HTTPCode_Upstream_3XX_Count</code></td><td>The number of HTTP 3XX responses generated by targets.</td><td>Sum</td></tr>
  <tr><td><code>HTTPCode_Upstream_4XX_Count</code></td><td>The number of HTTP 4XX responses generated by targets.</td><td>Sum</td></tr>
  <tr><td><code>HTTPCode_Upstream_5XX_Count</code></td><td>The number of HTTP 5XX responses generated by targets.</td><td>Sum</td></tr>
  <tr><td colspan="3"><b>Connection and TLS errors</b></td></tr>
  <tr><td><code>UpstreamConnectionErrorCount</code></td><td>The number of connections from the proxy to targets that failed to establish.</td><td>Sum</td></tr>
  <tr><td><code>ClientTLSNegotiationErrorCount</code></td><td>The number of TLS connections from clients that failed to establish a session.</td><td>Sum</td></tr>
  <tr><td><code>UpstreamTLSNegotiationErrorCount</code></td><td>The number of TLS connections from the proxy to targets that failed to establish a session.</td><td>Sum</td></tr>
  <tr><td colspan="3"><b>Latency</b></td></tr>
  <tr><td><code>UpstreamResponseTime</code></td><td>The time elapsed from when the request leaves the proxy until the proxy receives a response from the target.</td><td>Average</td></tr>
</tbody>
</table>


**Note**  
The `HTTPCode_Downstream_*` metrics count every response returned to clients, including responses the proxy generates. The `HTTPCode_Upstream_*` metrics count only responses the targets produce. Comparing a class across the two families indicates roughly where a response originated, but the match is not exact. The proxy does not publish 1XX counts, and the response classes do not sum exactly to `RequestCount`, which omits connections reset before any response.  
If you migrate from an Application Load Balancer, note that a proxy does not publish `HTTPCode_ELB_4XX_Count` or `HTTPCode_ELB_5XX_Count`. Use the `HTTPCode_Downstream_4XX_Count` and `HTTPCode_Downstream_5XX_Count` totals instead.

**Note**  
A proxy reports `UpstreamResponseTime` in milliseconds. If you migrate from an Application Load Balancer, note that the equivalent metric, `TargetResponseTime`, is reported in seconds.

## Statistics
<a name="monitoring-metrics-statistics"></a>

CloudWatch provides statistics based on the metric data points that a proxy publishes. The following statistics are the most useful for proxy metrics.
+ **Sum** is the total of the values over the period. It is the most meaningful statistic for the count metrics, such as `RequestCount` and the `HTTPCode_*` metrics.
+ **Average** is the sum divided by the sample count. Use it for the latency metric `UpstreamResponseTime`.
+ **Minimum**, **Maximum**, and **SampleCount** are also available, but they are less useful for the count metrics.