Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tf: module-monitoring-19 Group ES metrics by cluster #1095

Merged
merged 2 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tf/modules/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# tf-module-monitoring-19
- Change prometheus-elasticsearch metric alerts to group by cluster

# tf-module-monitoring-18
- Change QueryService PV alert alignment from sum to none

Expand Down
17 changes: 17 additions & 0 deletions tf/modules/monitoring/metric-alarms.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ locals {
threshold_value = 1
duration = "60s"
condition_absent = "300s"
min_group_by = "metric.label.es_cluster"
},
}
}
Expand All @@ -33,13 +34,29 @@ resource "google_monitoring_alert_policy" "alert_policy_prometheus_metric" {
count = each.value.trigger_count
}
threshold_value = each.value.threshold_value
aggregations {
alignment_period = "300s"
cross_series_reducer = "REDUCE_MIN"
group_by_fields = [
each.value.min_group_by,
]
per_series_aligner = "ALIGN_MEAN"
}
}
}
conditions {
display_name = "${each.value.display_name} absent"
condition_absent {
duration = each.value.condition_absent
filter = "resource.type = \"prometheus_target\" AND resource.labels.cluster = \"${var.cluster_name}\" AND ${each.value.filter}"
aggregations {
alignment_period = "300s"
cross_series_reducer = "REDUCE_MIN"
group_by_fields = [
each.value.min_group_by,
]
per_series_aligner = "ALIGN_MEAN"
}
}
}
combiner = "OR"
Expand Down