Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

Set up quota monitoring and alerting

Over time, the usage of your app's API quota might grow because of increased use of your app's service. To maintain a good user experience, we recommend using Stackdriver Monitoring to observe your app's API quota usage and alert you when you're running out of quota.

To set up the quota monitoring process in Stackdriver Monitoring, complete the following steps:

  1. If necessary, create a Stackdriver Monitoring workspace for your existing project.
  2. In the side navigation area, select Resources > Metrics Explorer.
  3. In the Find resource type and metric box, enter "Consumed API" and select the Consumed API resource type.
  4. Also in the Find resource type and metric box, enter "serviceruntime.googleapis.com/api/request_count" and select the Request count metric that appears.
  5. In the Filter box, enter "androidcheck.googleapis.com".
  6. In the Group By box, enter "project_id" and select the project_id resource label.
  7. In the Aggregator drop-down list, select sum.
  8. If desired, you can use more advanced aggregation options to change the alignment period. This configuration step might be necessary in order to monitor the number of calls made per day to the SafetyNet Attestation API.
  9. Create custom dashboards and alerts. For more information, see the following guides: