Skip to content

Commit

Permalink
GH-123: Email support when application logs error
Browse files Browse the repository at this point in the history
  • Loading branch information
markhobson committed Jul 4, 2024
1 parent e4f1086 commit cf3ccd4
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions cloud/schemes/cloud-run/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -370,3 +370,31 @@ resource "google_monitoring_alert_policy" "schemes_uptime" {
notification_channels = [google_monitoring_notification_channel.schemes[0].id]
severity = "CRITICAL"
}

resource "google_monitoring_alert_policy" "schemes_error" {
count = var.monitoring ? 1 : 0

display_name = "Schemes error alert"
combiner = "OR"

conditions {
display_name = "Cloud Run error"

condition_matched_log {
filter = join("", [
"resource.type=\"cloud_run_revision\" ",
"AND severity=ERROR"
])
}
}

notification_channels = [google_monitoring_notification_channel.schemes[0].id]

alert_strategy {
notification_rate_limit {
period = "300s"
}
}

severity = "ERROR"
}

0 comments on commit cf3ccd4

Please sign in to comment.