GCP APIs¶
Collect GCP APIs metrics.
Configuration¶
Install Func¶
We recommend enabling TrueWatch Integration - Extensions - Managed Func. All prerequisites are installed automatically; continue with the script installation.
If you deploy Func yourself, see Self-deploying Func.
Install Script¶
- Log in to the Func console, click [Script Market], open the TrueWatch Script Market, and search for
integration_gcp_apis. - Click [Install], then enter the required parameters: account file name, Target Principal, and account name.
- Click [Deploy Startup Script]. The system automatically creates a
Startupscript set and configures the corresponding startup script. - After enabling it, find the automatic trigger configuration under "Management / Automatic Trigger Configuration". Click [Execute] to run it immediately, then review the task record and logs.
Verification¶
- Under "Management / Automatic Trigger Configuration", confirm that the task exists and check its task records and logs for errors.
- In TrueWatch, check "Infrastructure / Custom" for the corresponding asset information.
- In TrueWatch, check "Metrics" for the corresponding measurement and monitoring data.
Metrics¶
GCP APIs metrics are stored in the gcp_apis measurement. The original metrics come from the Cloud Monitoring serviceruntime.googleapis.com/ namespace. Not every Google Cloud API produces Service Runtime metrics. The table below lists key metrics; see GCP APIs metrics for the complete metric catalog.
| Metric | Original Metric | Description | Unit |
|---|---|---|---|
| api_request_count | api/request_count |
Api request count | Count |
| api_request_latencies | api/request_latencies |
Api request latencies | s |
| api_request_sizes | api/request_sizes |
Api request sizes | Bytes |
| api_response_sizes | api/response_sizes |
Api response sizes | Bytes |
Common metric labels include service, method, response_code, protocol, credential_id, and location. Use them to analyze requests by API service, method, and response status.