Custom code run on each request to services

I can’t seem to find any information on this, and it might be because I don’t 100% understand Istio. But I have a series of microservices that all need to call 2 other microservices (1 for authentication/authorisation, and 1 for tracking requests for bill purposes).

So, you come into the cluster on theapi.tld/api/service-a

So istio routes that to ServiceA - but I really want the Istio Envoy proxy (or by some other mechanism), pass the HTTP headers, host and URL/URI to AuthService, then if that returns a 200, then it sends the same details to RequestTrack service, and then finally to the requested service.

That way I don’t need to have my services do all this over and over again, as there will be hundreds if not thousands of services eventually.

Any help here in regards to where/what I need to read would be really helpful.


Figured out you can add EnvoyFilters to forward requests to another service before sending to the destination service from the service mesh.