'How to get istio local ratelimiting metrics

I have configured the both local and global ratelimiting . I am able to get the global ratelimiting metrics using statsd, how can I get the local ratelimiting metrics ?



Solution 1:[1]

Istio local ratelimit exposes metrics mentioned in :

https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/local_rate_limit_filter#statistics

Need to configure the istio ingress gateway's default mesh config to emit these metrics (By default lot of metrics are omitted to conserve resources )

Within the configmap add following entries as per your metric patterns

defaultConfig:
  discoveryAddress: istiod.default.svc:15012
  proxyStatsMatcher:
    inclusionRegexps:
      - .*http_local_rate_limit.*
    inclusionPrefixes:
      - upstream_rq_retry
      - upstream_cx

You can check if stats are being emitted by querying :

kubectl exec -it <istio-ingress-pod> -c istio-proxy -- pilot-agent request GET stats

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nixon