FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit f44e6863 authored by Paul Rudin's avatar Paul Rudin
Browse files

add aggregations to alerting condition

parent bded7e4d
No related branches found
No related tags found
1 merge request!9Fix basic alerting so that it... alerts.
Pipeline #37748 passed
......@@ -60,16 +60,30 @@ resource "google_monitoring_alert_policy" "uptime_alert" {
display_name = "http check failing for ${var.monitored_domain}${var.polling_path}"
condition_threshold {
filter = <<-EOT
filter = <<-EOT
metric.type="monitoring.googleapis.com/uptime_check/check_passed" AND
metric.label.check_id="${google_monitoring_uptime_check_config.https[count.index].uptime_check_id}" AND
resource.type="uptime_url"
EOT
duration = "60s"
comparison = "COMPARISON_GT"
duration = "60s"
comparison = "COMPARISON_GT"
threshold_value = "1"
trigger { count = "1" }
}
# I don't fully understand this stuff, but leaving this empty doesn't
# work; although it used to (either the API or the terrfaform provider
# has changed). This config was arrived at my following
# https://cloud.google.com/monitoring/uptime-checks via the dashboard,
# and then examining the differences that terraform wants to apply. It
# seems to work OK.
aggregations {
alignment_period = "120s"
group_by_fields = ["resource.*"]
cross_series_reducer = "REDUCE_COUNT_FALSE"
per_series_aligner = "ALIGN_NEXT_OLDER"
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment