<p>I have azure front door sitting on front of a aks cluster which has istio and proxy sidecars injected into each pod.</p>
<p>Azure front door has health probes which hit a request at least once a second due to the number of azure front door endpoints. The number of requests the apps are getting is very high to the point I want to slow the interval It hits with the affect of losing the benefits of front door.</p>
<p>Microsoft suggest to code a telemetry initialiser in dotnet to mark requests as synthetic, however this seems like a massive problem that I would need to get multiple teams to buy into. As well as replicate to multiple languages.</p>
<p>Instead I would like to use an envoy filter to look at the header of the requests and if it matches the front door agent &quot;Edge Health Probe&quot; I would like to completely ignore it.</p>
<p>This would mean I am in control of what logs get sent to the app insights, can roll out a one fix fits all and would not need to involve the Devs.</p>
<p>I have looked to envoy filter but can't really understand how it would work.</p>
<p>Is this possible with envoy filter or does anyone know of a better method?</p>
<p>Thanks
Kevin</p>

Kevin
<p>You can do that with an <code>EnvoyFilter</code>. This example recognizes the header on the ingress gateway and simple sends a 200 response without sending it to the workloads:</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: custom-ms-header
  namespace: istio-system
spec:
  workloadSelector:
    labels:
      istio: ingressgateway
  configPatches:
    - applyTo: NETWORK_FILTER
      match:
        context: GATEWAY
        listener:
          filterChain:
            filter:
              name: envoy.filters.network.http_connection_manager
              subFilter:
                name: envoy.filters.network.http_connection_manager
      patch:
        operation: INSERT_BEFORE
        value:
          name: custom.ms-header
          typed_config:
            &quot;@type&quot;: type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua
            inlineCode: |
               function envoy_on_request(request_handle)
                 val = request_handle:headers():get(&quot;some-header&quot;)
                 if (val and val ~= &quot;some-value&quot;) then
                   request_handle:respond({[&quot;:status&quot;] = &quot;200&quot;}, &quot;ok&quot;)                        
                 end
               end
</code></pre>
<p>Alternatively you can apply it to match certain workloads</p>
<pre><code>[...]
    namespace: my-namespace
spec:
  workloadSelector:
    labels:
      istio: my-worklload
  configPatches:
    - applyTo: NETWORK_FILTER
      match:
        context: SIDECAR_INBOUND
        listener:
          filterChain:
[...]
</code></pre>
<p>Tough this requires you to apply it to every workload.</p>
