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

@Gregoire does the Telemetry object must be on the same namespace as the envoy being filtered? I mean, if I want to filter all logs on all my namespaces, do I need to have a telemetry object in each of them?

I’m asking this because right know I have a telemetry object in the istio-system namespace hoping for it to control the log processing for all my istio-proxies and I’m out of luck…

Istio / Telemetry => if a filter is declared in the istio-system namespace it should impact every workflow. but be ware, you can only create 1 telemetry resource without selector per namespace ! Not sure what happens if you have 2, but i’m guessing one it taken more or less randomly

I just found out what was my problem… I had a provider without filter and a filter without provider… :man_facepalming:

image

After fixing this, everything started working as expected, with the object in istio-system namespace.

1 Like