create_alert_policy
Create alert policies in GCP projects to monitor specific metrics, set thresholds, and define notification channels for timely issue detection and resolution.
Instructions
Create a new alert policy in a GCP project.
Args:
project_id: The ID of the GCP project
display_name: The display name for the alert policy
metric_type: The metric type to monitor (e.g., "compute.googleapis.com/instance/cpu/utilization")
filter_str: The filter for the metric data
duration_seconds: The duration in seconds over which to evaluate the condition (default: 60)
threshold_value: The threshold value for the condition (default: 0.0)
comparison: The comparison type (COMPARISON_GT, COMPARISON_LT, etc.) (default: COMPARISON_GT)
notification_channels: Optional list of notification channel IDs
Returns:
Result of the alert policy creation
Input Schema
Name | Required | Description | Default |
---|---|---|---|
comparison | No | COMPARISON_GT | |
display_name | Yes | ||
duration_seconds | No | ||
filter_str | Yes | ||
metric_type | Yes | ||
notification_channels | No | ||
project_id | Yes | ||
threshold_value | No |
Input Schema (JSON Schema)
{
"properties": {
"comparison": {
"default": "COMPARISON_GT",
"title": "Comparison",
"type": "string"
},
"display_name": {
"title": "Display Name",
"type": "string"
},
"duration_seconds": {
"default": 60,
"title": "Duration Seconds",
"type": "integer"
},
"filter_str": {
"title": "Filter Str",
"type": "string"
},
"metric_type": {
"title": "Metric Type",
"type": "string"
},
"notification_channels": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Notification Channels"
},
"project_id": {
"title": "Project Id",
"type": "string"
},
"threshold_value": {
"default": 0,
"title": "Threshold Value",
"type": "number"
}
},
"required": [
"project_id",
"display_name",
"metric_type",
"filter_str"
],
"title": "create_alert_policyArguments",
"type": "object"
}