Skip to content

Commit e7a5412

Browse files
committed
fix: remove unsupported incident.url variable from alert documentation
GCP Cloud Monitoring no longer supports the ${incident.url} variable in alert policy documentation templates — it renders as a literal error: 'Unrecognized variable: incident.url'. Replace with a direct link to the Cloud Logging query for recent errors.
1 parent 999ce4e commit e7a5412

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

infra/monitoring.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ resource "google_monitoring_alert_policy" "error_logs_policy" {
9999
content = <<-EOT
100100
## Error detected in Governance Watchdog Cloud Function
101101
102-
**View incident with logs:** $${incident.url}
103-
_(Click "View Logs" in the incident page to see logs around the error time)_
102+
**View logs around this incident:**
103+
https://console.cloud.google.com/logs/query;query=severity%3E%3DERROR%20AND%20resource.labels.service_name%3D%22${google_cloudfunctions2_function.watchdog_notifications.name}%22;timeRange=$${incident.started_at}%2F$${incident.started_at}PT1H
104104
105-
Or view all recent errors: https://console.cloud.google.com/logs/query;query=severity%3E%3DERROR%20AND%20resource.labels.service_name%3D%22${google_cloudfunctions2_function.watchdog_notifications.name}%22
105+
_(Link shows 1 hour of logs starting from when the alert fired)_
106106
EOT
107107
mime_type = "text/markdown"
108108
}

0 commit comments

Comments
 (0)