How to Populate current request rate for the API to target end-point

Not applicable

I need to forward the real-time API request-rate to my target end-point along with the API request. This is to enforce some algorithm on the target end-point where this will be one of the parameters to make the decision on whether the algorithm should be executed or not. I tried looking variables reference but couldn't find anything similar.

Request Rate = What I would put in Spike Arrest Policy , and I am interested in passing on the current rate to target-endpoint

Solved Solved
0 3 82
1 ACCEPTED SOLUTION

We can make use of flow variable, in Trace session check the flow variable for policy.

ratelimit.Spike-Arrest-1.available.count 
ratelimit.Quota-1.used.count

https://docs.apigee.com/api-platform/reference/policies/quota-policy#variables

View solution in original post

3 REPLIES 3

What do you mean by request-rate?

Is it the maximum number API Requests you can send to Apigee?

Yes , Request-Rate in this could be something that i would configure in say Spike Arrest policy.

Lets say I have added a rate of 100 rps to Spike Arrest. Now I need to know where I am at in real time , is it 10 rps ..20 rps or 80 rps.

We can make use of flow variable, in Trace session check the flow variable for policy.

ratelimit.Spike-Arrest-1.available.count 
ratelimit.Quota-1.used.count

https://docs.apigee.com/api-platform/reference/policies/quota-policy#variables