Skip to content

Commit

Permalink
Update docs and helm with latency metric
Browse files Browse the repository at this point in the history
Co-authored-by: Dean Coakley <dean.s.coakley@gmail.com>
  • Loading branch information
LorcanMcVeigh and Dean-Coakley authored Sep 18, 2020
1 parent 6581c74 commit ec96d09
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions deployments/helm-chart/templates/controller-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,5 @@ spec:
{{- end }}
- -ready-status={{ .Values.controller.readyStatus.enable }}
- -ready-status-port={{ .Values.controller.readyStatus.port }}
- -enable-latency-metrics={{ .Values.controller.enableLatencyMetrics }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,5 @@ spec:
{{- end }}
- -ready-status={{ .Values.controller.readyStatus.enable }}
- -ready-status-port={{ .Values.controller.readyStatus.port }}
- -enable-latency-metrics={{ .Values.controller.enableLatencyMetrics }}
{{- end }}
3 changes: 3 additions & 0 deletions deployments/helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ controller:
## Set the port where the readiness endpoint is exposed.
port: 8081

## Enable collection of latency metrics for upstreams. Requires prometheus.create.
enableLatencyMetrics: false

rbac:
## Configures RBAC.
create: true
Expand Down
1 change: 1 addition & 0 deletions docs-web/logging-and-monitoring/prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ 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.

Expand Down
4 changes: 2 additions & 2 deletions internal/metrics/collectors/latency.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,10 @@ func (l *LatencyFakeCollector) DeleteUpstreamServerPeerLabels([]string) {}
// UpdateUpstreamServerLabels implements a fake UpdateUpstreamServerLabels
func (l *LatencyFakeCollector) UpdateUpstreamServerLabels(map[string][]string) {}

// UpdateUpstreamServerLabels implements a fake DeleteUpstreamServerLabels
// DeleteUpstreamServerLabels implements a fake DeleteUpstreamServerLabels
func (l *LatencyFakeCollector) DeleteUpstreamServerLabels([]string) {}

// NewControllerFakeCollector creates a fake collector that implements the LatencyCollector interface
// NewLatencyFakeCollector creates a fake collector that implements the LatencyCollector interface
func NewLatencyFakeCollector() *LatencyFakeCollector {
return &LatencyFakeCollector{}
}
Expand Down

0 comments on commit ec96d09

Please sign in to comment.