Telemetry accessLogging filter

Hello,

I was trying to remove some noisy health check from my access log. I try to use Istio / Telemetry but without luck. As soon as I create an expression, all access logs are removed.

I tried a filter with “1==1” then “1==0” just to check but both removed all logs

apiVersion: telemetry.istio.io/v1alpha1
kind: Telemetry
metadata:
  name: filter-health-check-logs
  namespace: gateway
spec:
  accessLogging:
  - filter:
      expression: 1==1

( my original expression was request.headers['user-agent']!='LB-agent' but I reduced as I wasn’t sure what to do)

Is this the way to use this feature ? Did I miss something?

If I am reading the source code correctly, the access logging filter expression is only set (and used) when using the Stackdriver provider.

Ah! You mentioned providers.
So I check a little bit the code. The filter (I check in 1.5.2 code) is used on the providers (otel), but there is one default provider (envoy) to write logs. Not sure why when a providers is not set, all logs goes away, but setting the envoy provider resolve my issue.

apiVersion: telemetry.istio.io/v1alpha1
kind: Telemetry
metadata:
  name: filter-health-check-logs
  namespace: gateway
spec:
  accessLogging:
  - filter:
      expression: request.headers['user-agent']!='LB-agent'
    providers:
      - name: envoy
1 Like