From 9c7693e0dceb02eb4c39669db7423a245aac8105 Mon Sep 17 00:00:00 2001 From: Michael Pleshakov Date: Mon, 5 Oct 2020 13:00:28 -0700 Subject: [PATCH 1/2] Improve latency metrics documentation * Document -enable-latency-metrics cli arg * Update the metric doc in the Prometheus doc --- .../global-configuration/command-line-arguments.md | 5 +++++ docs-web/logging-and-monitoring/prometheus.md | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs-web/configuration/global-configuration/command-line-arguments.md b/docs-web/configuration/global-configuration/command-line-arguments.md index 98e7f1a15d..d7a96a3fee 100644 --- a/docs-web/configuration/global-configuration/command-line-arguments.md +++ b/docs-web/configuration/global-configuration/command-line-arguments.md @@ -204,6 +204,11 @@ Below we describe the available command-line arguments: - If the argument is set, but `nginx-plus` is set to false, or the `spire-agent-address` is not provided, the Ingress Controller will fail to start. +.. option:: -enable-latency-metrics + + Enable collection of latency metrics for upstreams. + Requires :option:`-enable-prometheus-metrics`. + .. option:: -enable-app-protect Enables support for App Protect. diff --git a/docs-web/logging-and-monitoring/prometheus.md b/docs-web/logging-and-monitoring/prometheus.md index 659aad6955..941e3e5715 100644 --- a/docs-web/logging-and-monitoring/prometheus.md +++ b/docs-web/logging-and-monitoring/prometheus.md @@ -23,8 +23,10 @@ If you're using *Helm* to install the Ingress Controller, to enable Prometheus m ## Available Metrics The Ingress Controller exports the following metrics: -* NGINX/NGINX Plus metrics. Please see this [doc](https://github.com/nginxinc/nginx-prometheus-exporter#exported-metrics) to find more information about the exported metrics. - +* NGINX/NGINX Plus metrics: + * Exported by NGINX/NGINX Plus. See this [doc](https://github.com/nginxinc/nginx-prometheus-exporter#exported-metrics) to find more information about the exported metrics. + * Calculated by the Ingress Controller: + * `controller_upstream_server_response_latency_ms_count`. Bucketed response times from when NGINX establishes a connection to an upstream server to when the last byte of the response body is received by NGINX. **Note**: The metric for the upstream isn't available until traffic is sent to the upstream. The metric isn't enabled by default. To enable the metric, set the `-enable-latency-metrics` command-line argument. * Ingress Controller metrics * `controller_nginx_reloads_total`. Number of successful NGINX reloads. This includes the label `reason` with 2 possible values `endpoints` (the reason for the reload was an endpoints update) and `other` (the reload was caused by something other than an endpoint update like an ingress update). * `controller_nginx_reload_errors_total`. Number of unsuccessful NGINX reloads. @@ -34,7 +36,6 @@ The Ingress Controller exports the following metrics: * `controller_ingress_resources_total`. Number of handled Ingress resources. This metric includes the label type, that groups the Ingress resources by their type (regular, [minion or master](/nginx-ingress-controller/configuration/ingress-resources/cross-namespace-configuration)). **Note**: The metric doesn't count minions without a master. * `controller_virtualserver_resources_total`. Number of handled VirtualServer resources. * `controller_virtualserverroute_resources_total`. Number of handled VirtualServerRoute resources. **Note**: The metric counts only VirtualServerRoutes that have a reference from a VirtualServer. - * `controller_upstream_server_response_latency_ms_count`. Bucketed response times from when NGINX establishes a connection to an upstream server to when the last byte of the response body is received by NGINX. **Note** The metric for the upstream isn't available until traffic is sent to the upstream. **Note**: all metrics have the namespace nginx_ingress. For example, nginx_ingress_controller_nginx_reloads_total. From 1f3feba4415d71d9b4f0649fb8d7c0385e6eeb9f Mon Sep 17 00:00:00 2001 From: Michael Pleshakov Date: Tue, 6 Oct 2020 17:57:30 +0100 Subject: [PATCH 2/2] Update docs-web/logging-and-monitoring/prometheus.md Co-authored-by: Jodie Putrino --- docs-web/logging-and-monitoring/prometheus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-web/logging-and-monitoring/prometheus.md b/docs-web/logging-and-monitoring/prometheus.md index 941e3e5715..76221a9108 100644 --- a/docs-web/logging-and-monitoring/prometheus.md +++ b/docs-web/logging-and-monitoring/prometheus.md @@ -24,7 +24,7 @@ If you're using *Helm* to install the Ingress Controller, to enable Prometheus m The Ingress Controller exports the following metrics: * NGINX/NGINX Plus metrics: - * Exported by NGINX/NGINX Plus. See this [doc](https://github.com/nginxinc/nginx-prometheus-exporter#exported-metrics) to find more information about the exported metrics. + * Exported by NGINX/NGINX Plus. Refer to the [NGINX Prometheus Exporter developer docs](https://github.com/nginxinc/nginx-prometheus-exporter#exported-metrics) to find more information about the exported metrics. * Calculated by the Ingress Controller: * `controller_upstream_server_response_latency_ms_count`. Bucketed response times from when NGINX establishes a connection to an upstream server to when the last byte of the response body is received by NGINX. **Note**: The metric for the upstream isn't available until traffic is sent to the upstream. The metric isn't enabled by default. To enable the metric, set the `-enable-latency-metrics` command-line argument. * Ingress Controller metrics