Conditional Filters in Spring Cloud Gateway

88 Views Asked by At

I have a use-case to measure the performance/latency of my proxy layer. For that I am planning to write script that will hit a burst of traffic on the actual service and extract the results out (TP99. TP95 and other needed metrics).

I want these metrics to be published only when the request is coming from this test script and not for actual production traffic (planning to add some custom headers in the request and run a specific filter only when the header is present).

Can someone suggest me ways of how this is possible to write a custom filter which run only when the given header is present and not run when that header value is not present.

0

There are 0 best solutions below