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:
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.