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

Firestore api is not being used by us but the api is running

We never use Cloud Firestore but it is somehow showing on enabled apis and we can see here it made 48 request and generated 100% error . Is there any way to track down the who is using the api it is showing on every project i have not enabled it Kindly help me.

image_2023_05_01T07_14_33_532Z.png

 

 

0 3 371
3 REPLIES 3



You can track API usage through a couple of different methods.

  1. Google Cloud Console: You can view the usage of APIs in the Google Cloud Console. For each project, you can navigate to the APIs & Services Dashboard to view the usage statistics for each API.

  2. Google Cloud's Operations Suite: Formerly known as Stackdriver, Google Cloud's Operations Suite provides more in-depth monitoring, logging, and diagnostics. It includes features to track API usage, including who is using the API and when.

  3. Audit logs: Audit logs in GCP can give you detailed information about who is accessing what resources, including API calls. There are several types of audit logs, including Admin Activity, Data Access, and System Event logs.

However,  there isn't a built-in feature that tracks API usage across all projects in a single view. You would need to check the API usage for each individual project.

If you want to consolidate this information across projects, you might need to programmatically extract the data from each project using the Cloud Logging API and then consolidate it. This would likely involve writing a script or application that uses the Cloud Logging API to fetch the audit logs from each project and then compiles the data in a way that makes sense for your use case.

 

I just need to know how it got enable on the first place. Is it enabled via any other service like app engine. 

GCP provides audit logs to track when a user enables an API for a given service. These logs are called "Admin Activity" audit logs, and they record administrative operations performed in your project.

To access these logs and see when a user enables an API for a service, follow these steps:

  1. Go to the Google Cloud Console: https://console.cloud.google.com/

  2. Select your project from the dropdown menu.

  3. Navigate to "Logging" > "Logs Explorer".

  4. In the "Query Builder" section, select "Resource Type: global" and "Log Name: activity.googleapis.com/admin-activity".

  5. To filter logs specific to API enablement, you can add the following advanced filter to the "Search query" box:

protoPayload.methodName="services.enable"

6. Click "Run Query" to see the logs.

The logs will show you information about the user who enabled the API, the time it was enabled, and the specific service that was affected.