Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Custom Reports - Quota Control

Hey! I want to implement a Quota control / report dynamically in Apigee. I want to see the current Quota of an API Product per Developer but I cannot find any result or example in the documentation.

I was testing with Apigee API stats endpoints but I cannot find detailed documentation about quota stats.

0 1 55
1 REPLY 1

Hi,

You are correct that Quota reporting is not available by default. However, Quota reports can be generated through Apigee Analytics by adding the Quota information you would like to see into Analytics as a custom value.

The first step is in deciding which Quota information you would like to capture. When the Quota policy is used, it generates a handful of useful flow variables. Please see https://cloud.google.com/apigee/docs/api-platform/reference/policies/quota-policy#variables for the list. Additionally, as you are looking for developer related information, depending on the security scheme for the proxy, you may need flow variables related to the developer. An example when using the VerifyAPIKey Policy: https://cloud.google.com/apigee/docs/api-platform/reference/policies/verify-api-key-policy#variables 

The second step is to add a DataCapture policy after the Quota policy has executed. The DataCapture policy captures data (such as payload, HTTP headers, and path or query parameters) from an API proxy for use in Analytics. You can use captured data in custom Analytics reports, as well as to implement monetization, and monitoring rules. See: https://cloud.google.com/apigee/docs/api-platform/reference/policies/data-capture-policy  We also have this guide on using custom data: https://cloud.google.com/apigee/docs/api-platform/analytics/using-data-capture 

Finally, you can create a custom report that includes the custom data you have added to Analytics: https://cloud.google.com/apigee/docs/api-platform/analytics/create-custom-reports 

Cheers,