Monitoring Metrics Reference
✅ Fresh -- Updated March 2026 from official Google Cloud documentation.
Complete reference for all API monitoring metrics available in Cloud Monitoring.
API Request Metrics
All metrics use the prefix serviceruntime.googleapis.com/.
| Metric | Type | Description | Labels |
|---|---|---|---|
api/request_count | Delta / Int64 | Total number of API requests | response_code, response_code_class, protocol, api_method |
api/request_latencies | Delta / Distribution | Request latency in milliseconds | response_code, api_method |
api/request_sizes | Delta / Distribution | Request payload size in bytes | api_method |
api/response_sizes | Delta / Distribution | Response payload size in bytes | api_method |
Quota Metrics
| Metric | Type | Description | Use |
|---|---|---|---|
quota/allocation/usage | Gauge / Int64 | Current allocation quota consumed | Track long-term quota usage |
quota/rate/net_usage | Delta / Int64 | Current rate limit consumption | Track per-minute/second limits |
quota/limit | Gauge / Int64 | Configured quota limit | Compare with usage for headroom |
quota/exceeded | Delta / Int64 | Number of times quota was exceeded | Alert on exhaustion |
Metric Labels
response_code
The HTTP status code of the response (e.g., 200, 404, 500).
response_code_class
Grouped HTTP status classes:
| Class | Meaning |
|---|---|
2xx | Success |
3xx | Redirect |
4xx | Client error |
5xx | Server error |
api_method
The specific API method called (e.g., google.pubsub.v1.Publisher.Publish).
protocol
The protocol used: http, grpc.
Example Monitoring Queries
Request Rate (MQL)
fetch consumed_api
| metric 'serviceruntime.googleapis.com/api/request_count'
| align rate(1m)
| every 1m
| group_by [resource.service], [value_request_count_aggregate: aggregate(value.request_count)]Error Rate Percentage
fetch consumed_api
| metric 'serviceruntime.googleapis.com/api/request_count'
| filter (metric.response_code_class = '4xx' || metric.response_code_class = '5xx')
| align rate(1m)
| every 1m
| group_by [resource.service], [value_request_count_aggregate: aggregate(value.request_count)]P99 Latency
fetch consumed_api
| metric 'serviceruntime.googleapis.com/api/request_latencies'
| align delta(1m)
| every 1m
| group_by [resource.service], [value_request_latencies_percentile: percentile(value.request_latencies, 99)]Quota Usage vs. Limit
fetch consumer_quota
| metric 'serviceruntime.googleapis.com/quota/allocation/usage'
| group_by [resource.service, metric.quota_metric], [value_usage: aggregate(value.usage)]Metrics Explorer Usage
Access Metrics Explorer in the Cloud Console:
https://console.cloud.google.com/monitoring/metrics-explorer?project=PROJECT_IDSteps to View API Metrics
- Open Metrics Explorer
- Set Resource type to
Consumed API - Set Metric to
Request count(or latencies, sizes) - Add Filters (e.g.,
service = storage.googleapis.com) - Set Aggregation to
SumorRate - Adjust Time range as needed
Dashboard Widgets
Recommended dashboard layout:
Alert Thresholds (Recommended)
| Metric | Condition | Threshold | Duration |
|---|---|---|---|
| Error rate | > percentage | 5% | 5 minutes |
| p99 latency | > value | 2000ms | 10 minutes |
| Quota usage | > percentage of limit | 80% | Instant |
| Traffic drop | < percentage of baseline | 50% | 15 minutes |
| Zero traffic | = value | 0 requests | 30 minutes |
See Also
- Monitoring Workflow -- How to set up monitoring end-to-end
- Troubleshooting -- Using metrics to diagnose issues
- Error Codes -- Error code details