1

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)

Veikko
  • 3,372
  • 2
  • 21
  • 31
Avinash Dhinwa
  • 370
  • 2
  • 13

1 Answers1

4

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

Veikko
  • 3,372
  • 2
  • 21
  • 31
  • 1
    I stumbled with the process for some time, so want to add - if you see several "Request count" metrics, you need the one serviceruntime.googleapis.com/api/request_count . Probably resource type should have filtered the others, but it did not for me, so I had to try a lot of them :-( – Dmitry Sep 13 '19 at 11:03
  • You are right. I see currently also long list of metrics with search "request count". Each of them has additional text that tells what they are in more detail. You can find the correct quickly by entering the long name "serviceruntime.googleapis.com/api/request_count". – Veikko Sep 13 '19 at 16:11
  • I added the full metric name to instructions to find it easily. I assume Google has added metrics to select from. Thanks for pointing this out Dmitry. – Veikko Sep 13 '19 at 16:15