Istio-proxy access log sampling rate

Is there a way to configure istio-proxy’s envoy access log, especially the sampling rate? I found that envoy provides a way to change various settings around access log, e.g. format and sampling rate, as follows:

However, I don’t know how I can configure the above through istio-proxy for istio-ingressgateway and sidecars.

I’m not sure about the sample rate, but you can control the encoding and format via the istio ConfigMap, which is usually configured via these helm values:

  • global.proxy.accessLogFile
  • global.proxy.accessLogEncoding
  • global.proxy.accessLogFormat

My config map looks like this:

    # Set accessLogFile to empty string to disable access log.
    accessLogFile: "/dev/stdout"

    # If accessLogEncoding is TEXT, value will be used directly as the log format
    # example: "[%START_TIME%] %REQ(:METHOD)% %REQ(X-ENVOY-ORIGINAL-PATH?:PATH)% %PROTOCOL%\n"
    # If AccessLogEncoding is JSON, value will be parsed as map[string]string
    # example: '{"start_time": "%START_TIME%", "req_method": "%REQ(:METHOD)%"}'
    # Leave empty to use default log format
    accessLogFormat: ""

    # Set accessLogEncoding to JSON or TEXT to configure sidecar access log
    accessLogEncoding: 'JSON'

Note: this only applies to v1.1 which will be released very soon.

Docs on this: https://preliminary.istio.io/docs/tasks/telemetry/access-log/

Thanks, @dwradcliffe. Do you happen to know how to do the same thing for the ingress gateway’s istio-proxy pod?

I believe the same settings apply to both.

FYI. I have just filed a new issue for access log sampling: https://github.com/istio/istio/issues/16210