query_metric
Query Google Cloud Monitoring metric time series with custom filters, time windows, and aggregation to analyze resource performance and troubleshoot incidents.
Instructions
Query a Cloud Monitoring metric time series.
Args: metric_type: Metric type, e.g. 'compute.googleapis.com/instance/cpu/utilization'. resource_filter: Optional extra filter, e.g. 'resource.labels.instance_id="123"'. window: How far back to query, e.g. '1h', '6h', '1d'. Default '1h'. aligner: Aggregation across the alignment period: MEAN, MAX, MIN, SUM, COUNT, RATE, PERCENTILE_99. Default MEAN. alignment_period: Bucket size for aggregation, e.g. '1m', '5m'. Default '5m'. limit: Maximum number of time series to return. environment: Which configured GCP environment to query, e.g. 'staging' or 'production'. Omit to use the default environment.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| window | No | 1h | |
| aligner | No | MEAN | |
| environment | No | ||
| metric_type | Yes | ||
| resource_filter | No | ||
| alignment_period | No | 5m |