Search code examples
google-cloud-platformstackdriversafetynet

"Android Device Verification" Service quota usage


I'm using Android Device Verification service (SafetyNet's attestation api), for verifying whether the request is sent from the same app which I built.

We have a quota limit of 10,000 (which can be increased) on the number of request we can do using SafetyNet's attestation api.

Now, I want to know if my limit is breached so that I can stop using that API. For that I was looking into stack-driver alerting but I couldn't find Android Device Verification service in it. (Even though I was able to find it in Quotas)


Solution

  • You can monitor Safetynet Attestations in Stackdriver by specifying these filters and settings:

    • Resource Type: Consumed API
    • Metric: Request count (type search term "serviceruntime.googleapis.com/api/request_count" to find correct count quickly)
    • Add Filter service = androidcheck.googleapis.com
    • Use aggregator "sum" to get the total count of requests.

    You can set advanced aggregation options to aggregate the daily level to compare with your quota. This can be done by setting Aligner: "sum" and Alignment period: "1440m". This gives daily sums of requests for the chart (1440m=24h*60m = number of minutes per day).

    stackdriver attestation metric