Skip to content

Commit 6f5c45a

Browse files
Merge pull request #194698 from asudbring/nat-metrics
Rework of NAT metrics article
2 parents 09b3142 + ba8bad9 commit 6f5c45a

File tree

9 files changed

+224
-15
lines changed

9 files changed

+224
-15
lines changed
310 KB
Loading
119 KB
Loading
209 KB
Loading
126 KB
Loading
161 KB
Loading
130 KB
Loading
158 KB
Loading
190 KB
Loading

articles/virtual-network/nat-gateway/nat-metrics.md

Lines changed: 224 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,30 @@
22
title: Metrics and alerts for Azure Virtual Network NAT
33
titleSuffix: Azure Virtual Network
44
description: Understand Azure Monitor metrics and alerts available for Virtual Network NAT.
5-
services: virtual-network
6-
documentationcenter: na
75
author: asudbring
86
manager: KumudD
97
ms.service: virtual-network
108
ms.subservice: nat
119
# Customer intent: As an IT administrator, I want to understand available Azure Monitor metrics and alerts for Virtual Network NAT.
1210
ms.topic: conceptual
13-
ms.tgt_pltfrm: na
14-
ms.workload: infrastructure-services
15-
ms.date: 03/04/2020
11+
ms.date: 04/12/2022
1612
ms.author: allensu
1713
---
14+
# Azure Virtual Network NAT metrics and alerts
1815

19-
# Azure Virtual Network NAT metrics
16+
This article provides an overview of all NAT gateway metrics and diagnostic capabilities. This article provides general guidance on how to use metrics and alerts to monitor, manage, and [troubleshoot](troubleshoot-nat.md) your NAT gateway resource.
2017

21-
Azure Virtual Network NAT gateway resources provide multi-dimensional metrics. You can use these metrics to observe the operation and for [troubleshooting](troubleshoot-nat.md). Alerts can be configured for critical issues such as SNAT exhaustion.
18+
Azure Virtual Network NAT gateway provides the following diagnostic capabilities:
2219

23-
:::image type="content" source="./media/nat-overview/flow-direction1.png" alt-text="Diagram depicts a NAT gateway resource that consumes all IP addresses for a public IP prefix and directs traffic to and from two subnets of VMs and a virtual machine scale set.":::
20+
- Multi-dimensional metrics and alerts through Azure Monitor. You can use these metrics to monitor and manage your NAT gateway and to assist you in troubleshooting issues.
21+
22+
- Network Insights: Azure Monitor Insights provides you with visual tools to view, monitor, and assist you in diagnosing issues with your NAT gateway resource. Insights provide you with a topological map of your Azure setup and metrics dashboards.
23+
24+
:::image type="content" source="./media/nat-overview/flow-direction1.png" alt-text="Diagram of a NAT gateway that consumes all IP addresses for a public IP prefix. The NAT gateway directs traffic to and from two subnets of VMs and a virtual machine scale set.":::
2425

2526
*Figure: Virtual Network NAT for outbound to Internet*
2627

27-
## Metrics
28+
## Metrics overview
2829

2930
NAT gateway resources provide the following multi-dimensional metrics in Azure Monitor:
3031

@@ -33,22 +34,230 @@ NAT gateway resources provide the following multi-dimensional metrics in Azure M
3334
| Bytes | Bytes processed inbound and outbound | Sum | Direction (In; Out), Protocol (6 TCP; 17 UDP) |
3435
| Packets | Packets processed inbound and outbound | Sum | Direction (In; Out), Protocol (6 TCP; 17 UDP) |
3536
| Dropped packets | Packets dropped by the NAT gateway | Sum | / |
36-
| SNAT Connection Count | Number of SNAT connections / State transitions per interval of time | Sum | Connection State, Protocol (6 TCP; 17 UDP) |
37-
| Total SNAT connection count | Current active SNAT connections (~ SNAT ports currently in use by NAT gateway) | Sum | Protocol (6 TCP; 17 UDP) |
38-
| Datapath availability (Preview) | Availability of the data path of the NAT gateway. Used to determine whether the NAT gateway endpoints are available for outbound traffic flow. | Avg | Availability (0, 100) |
37+
| SNAT Connection Count | Number of new SNAT connections over a given interval of time | Sum | Connection State, Protocol (6 TCP; 17 UDP) |
38+
| Total SNAT connection count | Total number of active SNAT connections (~ SNAT ports currently in use by NAT gateway) | Sum | Protocol (6 TCP; 17 UDP) |
39+
| Data path availability (Preview) | Availability of the data path of the NAT gateway. Used to determine whether the NAT gateway endpoints are available for outbound traffic flow. | Avg | Availability (0, 100) |
40+
41+
## Where to find my NAT gateway metrics
42+
43+
NAT gateway metrics can be found in the following locations in the Azure portal.
44+
45+
- **Metrics** page under **Monitoring** from a NAT gateway's resource page.
46+
47+
- **Insights** page under **Monitoring** from a NAT gateway's resource page.
48+
49+
:::image type="content" source="./media/nat-metrics/nat-insights-metrics.png" alt-text="Screenshot of the insights and metrics options in NAT gateway overview.":::
50+
51+
- Azure Monitor page under **Metrics**.
52+
53+
:::image type="content" source="./media/nat-metrics/azure-monitor.png" alt-text="Screenshot of the metrics section of Azure Monitor.":::
54+
55+
To view any one of your metrics for a given NAT gateway resource:
56+
57+
1. Select the NAT gateway resource you would like to monitor.
58+
59+
2. In the **Metric** drop-down menu, select one of the provided metrics.
60+
61+
3. In the **Aggregation** drop-down menu, select the recommended aggregation listed in the [metrics overview](#metrics-overview) table.
62+
63+
:::image type="content" source="./media/nat-metrics/nat-metrics-1.png" alt-text="Screenshot of the metrics setup configuration in NAT gateway resource.":::
64+
65+
4. To adjust the time frame over which the chosen metric is presented on the metrics graph or to adjust how frequently the chosen metric is measured, select the **Time** window in the top right corner of the metrics page and make your adjustments.
66+
67+
:::image type="content" source="./media/nat-metrics/nat-metrics-2.png" alt-text="Screenshot of the metrics time setup configuration in NAT gateway resource.":::
68+
69+
## How to use NAT gateway metrics
70+
71+
### Bytes
72+
73+
The **Bytes** metric shows you the amount of data going outbound through NAT gateway and returning inbound in response to an outbound connection.
74+
75+
Use this metric for the following measurements:
76+
77+
- Assess the amount of data being processed through NAT gateway to connect outbound or return inbound.
78+
79+
To view the amount of data sent in one or both directions when connecting outbound through NAT gateway:
80+
81+
1. Select the NAT gateway resource you would like to monitor.
82+
83+
2. In the **Metric** drop-down menu, select the **Bytes** metric.
84+
85+
3. In the **Aggregation** drop-down menu, select **Sum**.
86+
87+
4. Select to **Add filter**.
88+
89+
5. In the **Property** drop-down menu, select **Direction (Out | In)**.
90+
91+
6. In the **Values** drop-down menu, select **Out**, **In**, or both.
92+
93+
7. To see data processed inbound or outbound as their own individual lines in the metric graph, select **Apply splitting**.
94+
95+
8. In the **Values** drop-down menu, select **Direction (Out | In)**.
96+
97+
### Packets
98+
99+
The packets metric shows you the number of data packets transmitted through the NAT gateway.
100+
101+
Use this metric to:
102+
103+
- To confirm that traffic is being sent through your NAT gateway to go outbound to the internet or return inbound.
104+
105+
- To assess the amount of traffic being directed through your NAT gateway resource outbound or inbound (when in response to an outbound directed flow).
106+
107+
To view the number of packets sent in one or both directions when connecting outbound through NAT gateway, follow the same steps in the [Bytes](#bytes) section.
108+
109+
### Dropped packets
110+
111+
The dropped packets metric shows you the number of data packets dropped by NAT gateway when directing traffic outbound or inbound in response to an outbound connection.
112+
113+
Use this metric to:
114+
115+
- Assess whether or not you're nearing or possibly experiencing SNAT exhaustion with a given NAT gateway resource. Check to see if periods of dropped packets coincide with periods of failed SNAT connections with the [Total SNAT Connection Count](#total-snat-connection-count) metric.
116+
117+
- Help assess if you're experiencing a pattern of failed outbound connections.
118+
119+
Reasons for why you may see dropped packets:
120+
121+
- If you're seeing a high rate of dropped packets, it may be due to outbound connectivity failure. Connectivity failure may happen for various reasons. See the NAT gateway [troubleshooting guide](/azure/virtual-network/nat-gateway/troubleshoot-nat) to help you further diagnose.
122+
123+
### SNAT connection count
124+
125+
The SNAT connection count metric shows you the number of newly used SNAT ports within a specified time frame.
126+
127+
Use this metric to:
128+
129+
- Evaluate the number of successful and failed attempts to make outbound connections.
130+
131+
- Help assess if you're experiencing a pattern of failed outbound connections.
132+
133+
To view the number of attempted and failed connections:
134+
135+
1. Select the NAT gateway resource you would like to monitor.
136+
137+
2. In the **Metric** drop-down menu, select the **SNAT Connection Count** metric.
138+
139+
3. In the **Aggregation** drop-down menu, select **Sum**.
140+
141+
4. Select to **Add filter**.
142+
143+
5. In the **Property** drop-down menu, select **Connection State**.
144+
145+
6. In the **Values** drop-down menu, select **Attempted**, **Failed**, or both.
146+
147+
7. To see attempted and failed connections as their own individual lines in the metric graph, select **Apply splitting**.
148+
149+
8. In the **Values** drop-down menu, select **Connection State**.
150+
151+
:::image type="content" source="./media/nat-metrics/nat-metrics-3.png" alt-text="Screenshot of the metrics configuration.":::
152+
153+
Reasons for why you may see failed connections:
154+
155+
- If you're seeing a pattern of failed connections for your NAT gateway resource, there could be multiple possible reasons. See the NAT gateway [troubleshooting guide](/azure/virtual-network/nat-gateway/troubleshoot-nat) to help you further diagnose.
156+
157+
### Total SNAT connection count
158+
159+
The **Total SNAT connection count** metric shows you the total number of active SNAT connections over a period of time.
160+
161+
You can use this metric to:
162+
163+
- Monitor SNAT port utilization on a given NAT gateway resource.
164+
165+
- Analyze over a given time interval to provide insight on whether or not NAT gateway connectivity should be scaled out further by adding more public IPs.
166+
167+
- Assess whether or not you're nearing or possibly experiencing SNAT exhaustion with a given NAT gateway resource.
168+
169+
### Data path availability (Preview)
170+
171+
The data path availability metric measures the status of the NAT gateway resource over time. This metric informs on whether or not NAT gateway is available for directing outbound traffic to the internet. This metric is a reflection of the health of the Azure infrastructure.
172+
173+
You can use this metric to:
174+
175+
- Monitor the availability of your NAT gateway resource.
176+
177+
- Investigate the platform where your NAT gateway is deployed and determine if it’s healthy.
178+
179+
- Isolate whether an event is related to your NAT gateway or to the underlying data plane.
180+
181+
Reasons for why you may see a drop in data path availability include:
182+
183+
- An infrastructure outage has occurred.
184+
185+
- There aren't healthy VMs available in your NAT gateway configured subnet. For more information, see the NAT gateway [troubleshooting guide](/azure/virtual-network/nat-gateway/troubleshoot-nat).
39186

40187
## Alerts
41188

42-
Alerts for metrics can be configured in Azure Monitor for each of the preceding [metrics](#metrics).
189+
Alerts can be configured in Azure Monitor for each of the preceding metrics. These alerts proactively notify you when important conditions are found in your monitoring data. They allow you to identify and address potential issues with your NAT gateway resource.
190+
191+
For more information about how metric alerts work, see [Azure Monitor Metric Alerts](/azure/azure-monitor/alerts/alerts-metric-overview). See guidance below on how to configure some common and recommended types of alerts for your NAT gateway.
192+
193+
### Alerts for SNAT port usage
194+
195+
Use the total **SNAT connection count** metric and alerts for when you're nearing the limits of available SNAT ports.
196+
197+
To create the alert, use the following steps:
198+
199+
1. From the NAT gateway resource page, select **Alerts**.
200+
201+
2. Select **Create alert rule**.
202+
203+
3. From the signal list, select **Total SNAT Connection Count**.
204+
205+
4. From the **Operator** drop-down menu, select **Less than or equal to**.
206+
207+
5. From the **Aggregation type** drop-down menu, select **Total**.
208+
209+
6. In the **Threshold value** box, enter a percentage value that the Total SNAT connection count must drop below before an alert is fired. When deciding what threshold value to use, keep in mind how much you've scaled out your NAT gateway outbound connectivity with public IP addresses. For more information, see [Scale NAT gateway](/azure/virtual-network/nat-gateway/nat-gateway-resource#scale-nat-gateway).
210+
211+
7. From the **Unit** drop-down menu, select **Count**.
212+
213+
8. From the **Aggregation granularity (Period)** drop-down menu, select a time period over which you would like the SNAT connection count to be measured.
214+
215+
9. Create an **Action** for your alert by providing a name, notification type, and type of action that is performed when the alert is triggered.
216+
217+
10. Before deploying your action, **test the action group**.
218+
219+
11. Select **Create** to create the alert rule.
220+
221+
>[!NOTE]
222+
>SNAT exhaustion on your NAT gateway resource is uncommon. If you see SNAT exhaustion, your NAT gateway's idle timeout timer may be holding on to SNAT ports too long or your may need to scale with additional public IPs. To troubleshoot these kinds of issues, refer to the NAT gateway [troubleshooting guide](/azure/virtual-network/nat-gateway/troubleshoot-nat).
223+
224+
## Network Insights
225+
226+
[Azure Monitor Network Insights](/azure/azure-monitor/insights/network-insights-overview) allows you to visualize your Azure infrastructure setup and to review all metrics for your NAT gateway resource from a pre-configured metrics dashboard. These visual tools help you diagnose and troubleshoot any issues with your NAT gateway resource.
227+
228+
### View the topology of your Azure architectural setup
229+
230+
To view a topological map of your setup in Azure:
231+
232+
1. From your NAT gateway’s resource page, select **Insights** from the **Monitoring** section.
233+
234+
2. On the landing page for **Insights**, you'll see a topology map of your NAT gateway setup. This map will show you the relationship between the different components of your network (subnets, virtual machines, public IP addresses).
235+
236+
3. Hover over any component in the topology map to view configuration information.
237+
238+
:::image type="content" source="./media/nat-metrics/nat-insights.png" alt-text="Screenshot of the Insights section of NAT gateway.":::
239+
240+
### View all NAT gateway metrics in a dashboard
241+
242+
The metrics dashboard can be used to better understand the performance and health of your NAT gateway resource. The metrics dashboard shows a view of all metrics for NAT gateway on a single page.
243+
244+
- All NAT gateway metrics can be viewed in a dashboard when selecting **Show Metrics Pane**.
245+
246+
:::image type="content" source="./media/nat-metrics/nat-metrics-pane.png" alt-text="Screenshot of the show metrics pane.":::
247+
248+
- A full page view of all NAT gateway metrics can be viewed when selecting **View Detailed Metrics**.
249+
250+
:::image type="content" source="./media/nat-metrics/detailed-metrics.png" alt-text="Screenshot of the view detailed metrics.":::
251+
252+
For more information on what each metric is showing you and how to analyze these metrics, see [How to use NAT gateway metrics](#how-to-use-nat-gateway-metrics).
43253

44254
## Limitations
45255

46-
Resource health isn't supported.
256+
- Resource health isn't supported.
47257

48258
## Next steps
49259

50260
* Learn about [Virtual Network NAT](nat-overview.md)
51261
* Learn about [NAT gateway resource](nat-gateway-resource.md)
52262
* Learn about [Azure Monitor](../../azure-monitor/overview.md)
53263
* Learn about [troubleshooting NAT gateway resources](troubleshoot-nat.md).
54-
* [Tell us what to build next for Virtual Network NAT in UserVoice](https://aka.ms/natuservoice).

0 commit comments

Comments
 (0)