Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get "No data is available for the selected time frame"?

I have a Books API project, and the GCP shows "No data is available for the selected time frame" for the last 30 days. This message appears on both the "Metrics" and "Quotas" pages. See screenshots below.

Clearly there is data, which I can see via my app analytics reports.

Any suggestions on how to fix it?

enter image description here

enter image description here

UPDATE 1: Following are some points that were missing on the original post:

  • The Google Books API is used by an iOS app, which is available on the App Store and widely used across many iOS devices (iPhone and iPads) in many countries.
  • There are thousands of iOS devices running my app so the Google Books API calls are invoked from thousands of endpoints with different locations and different IPs. All endpoints are using the same API_KEY.
  • The Google Books API calls are performed successfully from the iOS devices and there is no API issue (I can clearly see that using analytics tool).
  • The only issue I have, is with GCP console not showing the number of the API calls (and other metrics) associated with my API_KEY. As you can see in the previous screenshots, I get "No data is available for the selected time frame" anywhere.
  • This is a regression issue since until recently I could successfully view the actual data of the API usage. I didn't change anything in this period.
  • When going to GCP > IAM & Admin > Quotas, you can clearly see that the app indeed consumes API calls (see screenshot below).

Any suggestion why would the GCP console tell that no data is available, while data is indeed available?

enter image description here

like image 540
Joshua Avatar asked Oct 28 '25 14:10

Joshua


1 Answers

Just putting this here since when I googled this was the first link that came up. I was experiencing the same issue. But my issue was on GKE's observability tab. I had enabled monitoring for the cluster but I was still getting the error above. I had to ensure the service account running GKE has these permissions:

  • Monitoring Metric Writer
  • Stackdriver Resource Metadata Writer

Thanks to this blog post which helped me figure this out after struggling to determine what was the issue. It's a shame GCP does not really document this important step.

like image 198
Muteshi Avatar answered Oct 30 '25 07:10

Muteshi