Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 2b63a56

Browse files
committed
exclude 'free' memory from the high memory alert
An instance with more than 90% of its memory in the "free" state is not something we want to alert on. Exclude state=free from the alert condition.
1 parent 359e1e2 commit 2b63a56

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

stackdriver/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ This module does not produce any outputs.
8484

8585
## Releases
8686

87+
* `stackdriver-2.2.2` - exclude "free" memory from the high memory usage alert
8788
* `stackdriver-2.2.1` - syntax error fix
8889
* `stackdriver-2.2.0` - Pub/Sub and Datastore alerts
8990
* `stackdriver-2.1.1` - adjust Cloud SQL write ops threshold

stackdriver/alert_policies.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ resource "google_monitoring_alert_policy" "memory_90" {
240240
display_name = "GCE VM Instance - Memory utilization"
241241

242242
condition_threshold {
243-
filter = "metric.type=\"agent.googleapis.com/memory/percent_used\" resource.type=\"gce_instance\""
243+
filter = "metric.type=\"agent.googleapis.com/memory/percent_used\" resource.type=\"gce_instance\" metric.label.\"state\"!=\"free\""
244244
duration = var.memory_duration
245245
comparison = "COMPARISON_GT"
246246
threshold_value = var.memory_threshold

0 commit comments

Comments
 (0)