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

fix(tf): sql alerting policy #1231

Merged
merged 5 commits into from
Nov 9, 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-21
- Attempt to fix the failed logical SQL backup alerting policy

# tf-module-monitoring-20
- Add alert policy for critical PV usage (Logical SQL Backup)
- Fix failed logcial SQL backup alert policy by setting duration to 24h instead of 24h 30m
Expand Down
9 changes: 9 additions & 0 deletions tf/modules/monitoring/sql-backup-failure-alert.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ resource "google_monitoring_alert_policy" "alert_policy_sql_logical_backup_failu
condition_absent {
filter = "metric.type=\"logging.googleapis.com/user/${google_logging_metric.sql_logical_backup_success.name}\" AND resource.type=\"k8s_container\""
duration = "86400s"

aggregations {
cross_series_reducer = "REDUCE_COUNT"
per_series_aligner = "ALIGN_COUNT"
alignment_period = "60s"
group_by_fields = [
"resource.labels.container_name",
]
}
trigger {
count = 1
}
Expand Down