Apigee - Spike Arrest / Rate limit conditional rate limiting execution based on client.ip

71 views Asked by At

pretty new to Apigee and still learning a lot.

Scenario is we are going to start bucketing requests by client.ip rather than bucketing for everything that comes into the API proxy but we have a list of IP addresses that are trusted i.e. monitoring tools and also our internal proxy servers.....there is a higher chance of those getting caught by rate limiting as there are higher volumes of traffic attributed to them. We want spike arrest and quota to be ignore for those list of trusted endpoints.

We are calling our spike arrest script using:

<PreFlow name="PreFlow">
  <Request>
    <Step> 
      <Name>SpikeArrest.SpikeArrest>
    </Step>
  </Request>
  <Response/>
</PreFlow>

and our Spike arrest code is:

    <SpikeArrest name="SpikeArrest.SpikeArrest">
      <Rate>100PS</Rate>
      <UseEffectiveCount>true</UseEffectiveCount>
    </SpikeArrest>

We will be moving towards the following Spike arrest code

   <SpikeArrest name="SpikeArrest.SpikeArrest">
     <Rate>20PS</Rate>
     <UseEffectiveCount>true</UseEffectiveCount>
     <Identifier ref="client.ip"/>
   </SpikeArrest>

Has anyone managed to implement conditional code that enables spike arrest and / or quota to run where client.ip is != to a list of trusted IP's...I think i somehow need to amend my pre-flow spike arrest step to conditionally execute only where client.ip != to a file that contains a list of trusted IP addresses....

If anyone has working example they could share, id appreciate as could see this on Apigee docs.

Checked Apigee docs for information and although pretty clear on vanilla spike arrest / quota settings, it doesnt really go down the conditional rabbit hole.

0

There are 0 answers