The Envoy proxy keeps detailed statistics about network traffic.
Envoy’s statistics only cover the traffic for a particular Envoy instance. See Observability for persistent per-service Istio telemetry. The statistics the Envoy proxies record can provide more information about specific pod instances.
To see the statistics for a pod:
$ kubectl exec "$POD" -c istio-proxy -- pilot-agent request GET stats
Envoy generates statistics about its behavior, scoping the statistics by proxy function. Examples include:
By default, Istio configures Envoy to record a minimal set of statistics to reduce the overall CPU and memory footprint of the installed proxies. The default collection keys are:
To see the Envoy settings for statistics data collection use
istioctl proxy-config bootstrap and follow the
deep dive into Envoy configuration.
Envoy only collects statistical data on items matching the
stats_matcher JSON element.
To configure Istio proxy to record additional statistics, you can add
ProxyConfig.ProxyStatsMatcher to your mesh config. For example, to enable stats for circuit breaker, retry, and upstream connections globally, you can specify stats matcher as follows:
apiVersion: install.istio.io/v1alpha1 kind: IstioOperator spec: meshConfig: defaultConfig: proxyStatsMatcher: inclusionRegexps: - ".*circuit_breakers.*" inclusionPrefixes: - "upstream_rq_retry" - "upstream_cx"
You can also override the global stats matching configuration per proxy by using the
proxy.istio.io/config annotation. For example, to configure the same stats generation inclusion as above, you can add the annotation to a gateway proxy or a workload as follows:
metadata: annotations: proxy.istio.io/config: |- proxyStatsMatcher: inclusionRegexps: - ".*circuit_breakers.*" inclusionPrefixes: - "upstream_rq_retry" - "upstream_cx"