应用程序网关的指标Metrics for Application Gateway

应用程序网关会将称为“指标”的数据点发布到 Azure Monitor,使用户能够监视应用程序网关和后端实例的性能。Application Gateway publishes data points, called metrics, to Azure Monitor for the performance of your Application Gateway and backend instances. 这些指标是一组有序时序数据中的数值,用于描述应用程序网关在特定时间的某种状况。These metrics are numerical values in an ordered set of time-series data that describe some aspect of your application gateway at a particular time. 如果请求通过应用程序网关传送,则应用程序网关将会测量其指标并每隔 60 秒发送一次指标。If there are requests flowing through the Application Gateway, it measures and sends its metrics in 60-second intervals. 如果没有任何请求通过应用程序网关传送,或者指标没有数据,则不会报告指标。If there are no requests flowing through the Application Gateway or no data for a metric, the metric is not reported. 有关详细信息,请参阅 Azure Monitor 指标For more information, see Azure Monitor metrics.

应用程序网关 V2 SKU 支持的指标Metrics supported by Application Gateway V2 SKU

计时指标Timing metrics

应用程序网关提供多个与请求和响应相关的内置计时指标,这些指标的度量单位均为毫秒。Application Gateway provides several built‑in timing metrics related to the request and response, which are all measured in milliseconds.

用于应用程序网关的计时指标图。

备注

如果应用程序网关中有多个侦听器,则请在比较不同的延迟指标时始终按“侦听器”维度进行筛选,以便获得有意义的推理结果。If there are more than one listener in the Application Gateway, then always filter by Listener dimension while comparing different latency metrics in order to get meaningful inference.

  • 后端连接时间Backend connect time

    与后端应用程序建立连接所花费的时间。Time spent establishing a connection with the backend application.

    这包括网络延迟,以及后端服务器的 TCP 堆栈建立新连接所用的时间。This includes the network latency as well as the time taken by the backend server’s TCP stack to establish new connections. 对于 TLS,它还包括握手所用时间。In case of TLS, it also includes the time spent on handshake.

  • 后端第一个字节响应时间Backend first byte response time

    从开始与后端服务器建立连接,到收到响应标头的第一个字节的间隔时间。Time interval between start of establishing a connection to backend server and receiving the first byte of the response header.

    此时间近似于“后端连接时间”、请求从应用程序网关抵达后端所用的时间、后端应用程序做出响应所用的时间(服务器生成内容并可能提取数据库查询所用的时间),以及响应的第一个字节从后端抵达应用程序网关所用的时间之和。This approximates the sum of Backend connect time, time taken by the request to reach the backend from Application Gateway, time taken by backend application to respond (the time the server took to generate content, potentially fetch database queries), and the time taken by first byte of the response to reach the Application Gateway from the backend.

  • 后端最后一个字节响应时间Backend last byte response time

    从开始与后端服务器建立连接,到收到响应正文的最后一个字节的间隔时间。Time interval between start of establishing a connection to backend server and receiving the last byte of the response body.

    此时间近似于“后端第一字节响应时间”以及数据传输时间(此数字根据请求对象的大小和服务器网络延迟而有很大的不同)之和。This approximates the sum of Backend first byte response time and data transfer time (this number may vary greatly depending on the size of objects requested and the latency of the server network).

  • 应用程序网关总时间Application gateway total time

    接收、处理请求及发送其响应所花费的平均时间。Average time that it takes for a request to be received, processed and its response to be sent.

    此间隔时间是根据从应用程序网关收到 HTTP 请求的第一个字节的时间,到将最后一个响应字节发送到客户端的时间计算的。This is the interval from the time when Application Gateway receives the first byte of the HTTP request to the time when the last response byte has been sent to the client. 这包括应用程序网关花费的处理时间、“后端最后一个字节响应时间”、应用程序网关发送所有响应所用的时间,以及“客户端 RTT”。 This includes the processing time taken by Application Gateway, the Backend last byte response time, time taken by Application Gateway to send all the response and the Client RTT.

  • 客户端 RTTClient RTT

    客户端与应用程序网关之间的平均往返时间。Average round trip time between clients and Application Gateway.

这些指标可用于确定速度减慢的原因是与客户端网络、应用程序网关性能、后端网络和后端服务器 TCP 堆栈饱和、后端应用程序性能还是文件大小较大有关。These metrics can be used to determine whether the observed slowdown is due to the client network, Application Gateway performance, the backend network and backend server TCP stack saturation, backend application performance, or large file size.

例如,如果“后端第一个字节响应时间”趋势存在高峰,但“后端连接时间”趋势稳定,则可以推断应用程序网关与后端之间存在网络延迟,但建立连接所用的时间是稳定的,而出现高峰的原因是后端应用程序的响应时间增大。 For example, If there’s a spike in Backend first byte response time trend but the Backend connect time trend is stable, then it can be inferred that the Application gateway to backend latency and the time taken to establish the connection is stable, and the spike is caused due to an increase in the response time of backend application. 另一方面,如果“后端第一个字节响应时间”中的高峰与“后端连接时间”中的相应高峰相关联,则可以推断应用程序网关与后端服务器或后端服务器 TCP 堆栈之间的网络已饱和。 On the other hand, if the spike in Backend first byte response time is associated with a corresponding spike in Backend connect time, then it can be deduced that either the network between Application Gateway and backend server or the backend server TCP stack has saturated.

如果观察到“后端最后一个字节响应时间”出现高峰,但“后端第一个字节响应时间”稳定,则可以推断出现此高峰的原因是请求的文件较大。 If you notice a spike in Backend last byte response time but the Backend first byte response time is stable, then it can be deduced that the spike is because of a larger file being requested.

同理,如果“应用程序网关总时间”出现高峰,但“后端最后一个字节响应时间”稳定,则可能表示应用程序网关出现性能瓶颈,或者客户端与应用程序网关之间的网络出现瓶颈。 Similarly, if the Application gateway total time has a spike but the Backend last byte response time is stable, then it can either be a sign of performance bottleneck at the Application Gateway or a bottleneck in the network between client and Application Gateway. 此外,如果“客户端 RTT”也出现相应的高峰,则指示出现这种性能下降的原因是客户端与应用程序网关之间的网络有问题。Additionally, if the client RTT also has a corresponding spike, then it indicates that the degradation is because of the network between client and Application Gateway.

应用程序网关指标Application Gateway metrics

应用程序网关支持以下指标:For Application Gateway, the following metrics are available:

  • 接收的字节数Bytes received

    应用程序网关从客户端收到的字节数Count of bytes received by the Application Gateway from the clients

  • 发送的字节数Bytes sent

    应用程序网关向客户端发送的字节数Count of bytes sent by the Application Gateway to the clients

  • 客户端 TLS 协议Client TLS protocol

    与应用程序网关建立了连接的客户端发起的 TLS 和非 TLS 请求计数。Count of TLS and non-TLS requests initiated by the client that established connection with the Application Gateway. 若要查看 TLS 协议分布,请按“TLS 协议”维度进行筛选。To view TLS protocol distribution, filter by the dimension TLS Protocol.

  • 当前容量单位数Current capacity units

    用于对流量进行负载均衡的容量单位计数。Count of capacity units consumed to load balance the traffic. 容量单位有三个决定因素 - 计算单位、持久连接和吞吐量。There are three determinants to capacity unit - compute unit, persistent connections and throughput. 每个容量单位最多包括:1 个计算单位,或 2500 个持久连接,或 2.22-Mbps 吞吐量。Each capacity unit is composed of at most: 1 compute unit, or 2500 persistent connections, or 2.22-Mbps throughput.

  • 当前计算单位数Current compute units

    消耗的处理器容量计数。Count of processor capacity consumed. 影响计算单位的因素包括每秒 TLS 连接数、URL 重写计算和 WAF 规则处理。Factors affecting compute unit are TLS connections/sec, URL Rewrite computations, and WAF rule processing.

  • 当前连接数Current connections

    从客户端到应用程序网关的活动并发连接总数The total number of concurrent connections active from clients to the Application Gateway

  • 估计计费容量单位数Estimated Billed Capacity units

    使用 v2 SKU,定价模型由消耗量驱动。With the v2 SKU, the pricing model is driven by consumption. 容量单位测量在固定价格的基础上按消耗量计收的费用。Capacity units measure consumption-based cost that is charged in addition to the fixed cost. “估计计费容量单位数”指示用于估计计费的容量单位数。Estimated Billed Capacity units indicate the number of capacity units using which the billing is estimated. 此项按“当前容量单位数”(对流量进行负载均衡所需的容量单位数)和“固定计费容量单位数”(保持预配的最小容量单位数)之间的较大值进行计算。This is calculated as the greater value between Current capacity units (capacity units required to load balance the traffic) and Fixed billable capacity units (minimum capacity units kept provisioned).

  • 失败的请求数Failed Requests

    应用程序网关已处理但显示了 5xx 服务器错误代码的请求数。Number of requests that Application Gateway has served with 5xx server error codes. 这包括从应用程序网关生成的 5xx 代码,以及从后端生成的 5xx 代码。This includes the 5xx codes that are generated from the Application Gateway as well as the 5xx codes that are generated from the backend. 可以进一步筛选请求计数,以显示每个/特定后端池 http 设置组合的计数。The request count can be further filtered to show count per each/specific backend pool-http setting combination.

  • 固定计费容量单位数Fixed Billable Capacity Units

    根据应用程序网关配置中的“最小缩放单位数”设置(一个实例转换为 10 个容量单位)保持预配的最小容量单位数。The minimum number of capacity units kept provisioned as per the Minimum scale units setting (one instance translates to 10 capacity units) in the Application Gateway configuration.

  • 每秒新连接数New connections per second

    每秒从客户端到应用程序网关以及从应用程序网关到后端成员建立的新 TCP 连接的平均数目。The average number of new TCP connections per second established from clients to the Application Gateway and from the Application Gateway to the backend members.

  • 响应状态Response Status

    应用程序网关返回的 HTTP 响应状态。HTTP response status returned by Application Gateway. 可以进一步对响应状态代码分布进行归类来显示 2xx、3xx、4xx 和 5xx 类别的响应。The response status code distribution can be further categorized to show responses in 2xx, 3xx, 4xx, and 5xx categories.

  • 吞吐量Throughput

    应用程序网关每秒提供的字节数Number of bytes per second the Application Gateway has served

  • 请求总数Total Requests

    应用程序网关已提供服务的成功请求计数。Count of successful requests that Application Gateway has served. 可以进一步筛选请求计数,以显示每个/特定后端池 http 设置组合的计数。The request count can be further filtered to show count per each/specific backend pool-http setting combination.

后端指标Backend metrics

应用程序网关支持以下指标:For Application Gateway, the following metrics are available:

  • 后端响应状态Backend response status

    后端返回的 HTTP 响应状态代码计数。Count of HTTP response status codes returned by the backends. 这不包括应用程序网关生成的任何响应代码。This does not include any response codes generated by the Application Gateway. 可以进一步对响应状态代码分布进行归类来显示 2xx、3xx、4xx 和 5xx 类别的响应。The response status code distribution can be further categorized to show responses in 2xx, 3xx, 4xx, and 5xx categories.

  • 正常的主机计数Healthy host count

    由运行状况探测判定为正常的后端数。The number of backends that are determined healthy by the health probe. 可以按每个后端池进行筛选来显示特定后端池中的正常主机数。You can filter on a per backend pool basis to show the number of healthy hosts in a specific backend pool.

  • 不正常的主机计数Unhealthy host count

    由运行状况探测判定为不正常的后端数。The number of backends that are determined unhealthy by the health probe. 可以按每个后端池进行筛选来显示特定后端池中的不正常主机数。You can filter on a per backend pool basis to show the number of unhealthy hosts in a specific backend pool.

  • 每个正常主机每分钟的请求数Requests per minute per Healthy Host

    后端池中的每个正常成员在一分钟内收到的平均请求数。The average number of requests received by each healthy member in a backend pool in a minute. 必须使用 BackendPool HttpSettings 维度指定后端池。You must specify the backend pool using the BackendPool HttpSettings dimension.

应用程序网关 V1 SKU 支持的指标Metrics supported by Application Gateway V1 SKU

应用程序网关指标Application Gateway metrics

应用程序网关支持以下指标:For Application Gateway, the following metrics are available:

  • CPU 使用率CPU Utilization

    显示分配给应用程序网关的 CPU 的使用率。Displays the utilization of the CPUs allocated to the Application Gateway. 正常情况下,CPU 使用率不应经常超过 90%,因为这可能导致托管在应用程序网关后面的网站中出现延迟,并破坏客户端体验。Under normal conditions, CPU usage should not regularly exceed 90%, as this may cause latency in the websites hosted behind the Application Gateway and disrupt the client experience. 可以通过修改应用程序网关的配置(具体方法是:增加实例计数和/或移到更大的 SKU 大小)来间接控制或改进 CPU 使用率。You can indirectly control or improve CPU utilization by modifying the configuration of the Application Gateway by increasing the instance count or by moving to a larger SKU size, or doing both.

  • 当前连接数Current connections

    使用应用程序网关建立的当前连接计数Count of current connections established with Application Gateway

  • 失败的请求数Failed Requests

    应用程序网关已处理但显示了 5xx 服务器错误代码的请求数。Number of requests that Application Gateway has served with 5xx server error codes. 这包括从应用程序网关生成的 5xx 代码,以及从后端生成的 5xx 代码。This includes the 5xx codes that are generated from the Application Gateway as well as the 5xx codes that are generated from the backend. 可以进一步筛选请求计数,以显示每个/特定后端池 http 设置组合的计数。The request count can be further filtered to show count per each/specific backend pool-http setting combination.

  • 响应状态Response Status

    应用程序网关返回的 HTTP 响应状态。HTTP response status returned by Application Gateway. 可以进一步对响应状态代码分布进行归类来显示 2xx、3xx、4xx 和 5xx 类别的响应。The response status code distribution can be further categorized to show responses in 2xx, 3xx, 4xx, and 5xx categories.

  • 吞吐量Throughput

    应用程序网关每秒提供的字节数Number of bytes per second the Application Gateway has served

  • 请求总数Total Requests

    应用程序网关已提供服务的成功请求计数。Count of successful requests that Application Gateway has served. 可以进一步筛选请求计数,以显示每个/特定后端池 http 设置组合的计数。The request count can be further filtered to show count per each/specific backend pool-http setting combination.

  • Web 应用程序防火墙阻止的请求计数Web Application Firewall Blocked Requests Count

  • Web 应用程序防火墙阻止的请求分发Web Application Firewall Blocked Requests Distribution

  • Web 应用程序防火墙规则分发总数Web Application Firewall Total Rule Distribution

后端指标Backend metrics

应用程序网关支持以下指标:For Application Gateway, the following metrics are available:

  • 正常的主机计数Healthy host count

    由运行状况探测判定为正常的后端数。The number of backends that are determined healthy by the health probe. 可以按每个后端池进行筛选来显示特定后端池中的正常主机数。You can filter on a per backend pool basis to show the number of healthy hosts in a specific backend pool.

  • 不正常的主机计数Unhealthy host count

    由运行状况探测判定为不正常的后端数。The number of backends that are determined unhealthy by the health probe. 可以按每个后端池进行筛选来显示特定后端池中的不正常主机数。You can filter on a per backend pool basis to show the number of unhealthy hosts in a specific backend pool.

指标可视化Metrics visualization

浏览到应用程序网关,并在“监视”下选择“指标” 。Browse to an application gateway, under Monitoring select Metrics. 若要查看可用值,请选择“指标”下拉列表。To view the available values, select the METRIC drop-down list.

在下图中可以看到过去 30 分钟显示的三个指标的示例:In the following image, you see an example with three metrics displayed for the last 30 minutes:

若要查看当前的指标列表,请参阅 Azure Monitor 支持的指标To see a current list of metrics, see Supported metrics with Azure Monitor.

后续步骤Next steps