MON-224 forecast monitors generalized
This commit is contained in:
parent
5293e24faf
commit
6cd1a0a553
@ -37,13 +37,19 @@ Creates DataDog monitors with the following checks:
|
||||
| delay | Delay in seconds for the metric evaluation | string | `900` | no |
|
||||
| disk_utilization_enabled | Whether or not to create the monitor | string | `true` | no |
|
||||
| disk_utilization_extra_tags | Extra tags for GCP Cloud SQL CPU Utilization monitor | list | `<list>` | no |
|
||||
| disk_utilization_forecast_algorithm | Algorithm for the Disk Utilization Forecast monitor | string | `linear` | no |
|
||||
| disk_utilization_forecast_deviations | Deviations for the Disk Utilization Forecast monitor | string | `1` | no |
|
||||
| disk_utilization_forecast_enabled | Whether or not to create the monitor | string | `true` | no |
|
||||
| disk_utilization_forecast_extra_tags | Extra tags for GCP Cloud SQL CPU Utilization monitor | list | `<list>` | no |
|
||||
| disk_utilization_forecast_message | Custom message for the Disk Utilization monitor | string | `` | no |
|
||||
| disk_utilization_forecast_silenced | Groups to mute for GCP Cloud SQL Disk Utilization monitor | map | `<map>` | no |
|
||||
| disk_utilization_forecast_threshold_critical | Disk Utilization in percentage (critical threshold) | string | `80` | no |
|
||||
| disk_utilization_forecast_threshold_critical_recovery | Disk Utilization in percentage (recovery threshold) | string | `72` | no |
|
||||
| disk_utilization_forecast_timeframe | Timeframe for the Disk Utilization monitor | string | `next_1w` | no |
|
||||
| disk_utilization_forecast_extra_tags | Extra tags for GCP Cloud SQL Disk Utilization Forecast monitor | list | `<list>` | no |
|
||||
| disk_utilization_forecast_interval | Interval for the Disk Utilization Forecast monitor | string | `60m` | no |
|
||||
| disk_utilization_forecast_linear_history | History for the Disk Utilization Forecast monitor | string | `3d` | no |
|
||||
| disk_utilization_forecast_linear_model | Model for the Disk Utilization Forecast monitor | string | `default` | no |
|
||||
| disk_utilization_forecast_message | Custom message for the Disk Utilization Forecast monitor | string | `` | no |
|
||||
| disk_utilization_forecast_seasonal_seasonality | Seasonality for the Disk Utilization Forecast monitor | string | `weekly` | no |
|
||||
| disk_utilization_forecast_silenced | Groups to mute for GCP Cloud SQL Disk Utilization Forecast monitor | map | `<map>` | no |
|
||||
| disk_utilization_forecast_threshold_critical | Disk Utilization Forecast in percentage (critical threshold) | string | `80` | no |
|
||||
| disk_utilization_forecast_threshold_critical_recovery | Disk Utilization Forecast in percentage (recovery threshold) | string | `72` | no |
|
||||
| disk_utilization_forecast_timeframe | Timeframe for the Disk Utilization Forecast monitor | string | `next_1w` | no |
|
||||
| disk_utilization_message | Custom message for the Disk Utilization monitor | string | `` | no |
|
||||
| disk_utilization_silenced | Groups to mute for GCP Cloud SQL Disk Utilization monitor | map | `<map>` | no |
|
||||
| disk_utilization_threshold_critical | Disk Utilization in percentage (critical threshold) | string | `90` | no |
|
||||
@ -60,11 +66,15 @@ Creates DataDog monitors with the following checks:
|
||||
| filter_tags_use_defaults | Use default filter tags convention | string | `true` | no |
|
||||
| memory_utilization_enabled | Whether or not to create the monitor | string | `true` | no |
|
||||
| memory_utilization_extra_tags | Extra tags for GCP Cloud SQL Memory Utilization monitor | list | `<list>` | no |
|
||||
| memory_utilization_forecast_algorithm | Algorithm for the Memory Utilization Forecast monitor | string | `linear` | no |
|
||||
| memory_utilization_forecast_deviations | Deviations for the Memory Utilization Forecast monitor | string | `1` | no |
|
||||
| memory_utilization_forecast_enabled | Whether or not to create the monitor | string | `true` | no |
|
||||
| memory_utilization_forecast_extra_tags | Extra tags for GCP Cloud SQL Memory Utilization Forecast monitor | list | `<list>` | no |
|
||||
| memory_utilization_forecast_history | History for the Memory Utilization Forecast monitor | string | `12h` | no |
|
||||
| memory_utilization_forecast_interval | Interval for the Memory Utilization Forecast monitor | string | `30m` | no |
|
||||
| memory_utilization_forecast_linear_history | History for the Memory Utilization Forecast monitor | string | `12h` | no |
|
||||
| memory_utilization_forecast_linear_model | Model for the Memory Utilization Forecast monitor | string | `default` | no |
|
||||
| memory_utilization_forecast_message | Custom message for the Memory Utilization Forecast monitor | string | `` | no |
|
||||
| memory_utilization_forecast_seasonal_seasonality | Seasonality for the Memory Utilization Forecast monitor | string | `weekly` | no |
|
||||
| memory_utilization_forecast_silenced | Groups to mute for GCP Cloud SQL Memory Utilization Forecast monitor | map | `<map>` | no |
|
||||
| memory_utilization_forecast_threshold_critical | Memory Utilization Forecast in percentage (warning threshold) | string | `90` | no |
|
||||
| memory_utilization_forecast_threshold_critical_recovery | Memory Utilization Forecast in percentage (recovery threshold) | string | `81` | no |
|
||||
|
||||
@ -133,37 +133,73 @@ variable "disk_utilization_forecast_enabled" {
|
||||
}
|
||||
|
||||
variable "disk_utilization_forecast_message" {
|
||||
description = "Custom message for the Disk Utilization monitor"
|
||||
description = "Custom message for the Disk Utilization Forecast monitor"
|
||||
type = "string"
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "disk_utilization_forecast_timeframe" {
|
||||
description = "Timeframe for the Disk Utilization monitor"
|
||||
description = "Timeframe for the Disk Utilization Forecast monitor"
|
||||
type = "string"
|
||||
default = "next_1w"
|
||||
}
|
||||
|
||||
variable "disk_utilization_forecast_algorithm" {
|
||||
description = "Algorithm for the Disk Utilization Forecast monitor"
|
||||
type = "string"
|
||||
default = "linear"
|
||||
}
|
||||
|
||||
variable "disk_utilization_forecast_deviations" {
|
||||
description = "Deviations for the Disk Utilization Forecast monitor"
|
||||
type = "string"
|
||||
default = 1
|
||||
}
|
||||
|
||||
variable "disk_utilization_forecast_interval" {
|
||||
description = "Interval for the Disk Utilization Forecast monitor"
|
||||
type = "string"
|
||||
default = "60m"
|
||||
}
|
||||
|
||||
variable "disk_utilization_forecast_linear_history" {
|
||||
description = "History for the Disk Utilization Forecast monitor"
|
||||
type = "string"
|
||||
default = "3d"
|
||||
}
|
||||
|
||||
variable "disk_utilization_forecast_linear_model" {
|
||||
description = "Model for the Disk Utilization Forecast monitor"
|
||||
type = "string"
|
||||
default = "default"
|
||||
}
|
||||
|
||||
variable "disk_utilization_forecast_seasonal_seasonality" {
|
||||
description = "Seasonality for the Disk Utilization Forecast monitor"
|
||||
type = "string"
|
||||
default = "weekly"
|
||||
}
|
||||
|
||||
variable "disk_utilization_forecast_threshold_critical" {
|
||||
description = "Disk Utilization in percentage (critical threshold)"
|
||||
description = "Disk Utilization Forecast in percentage (critical threshold)"
|
||||
type = "string"
|
||||
default = 80
|
||||
}
|
||||
|
||||
variable "disk_utilization_forecast_threshold_critical_recovery" {
|
||||
description = "Disk Utilization in percentage (recovery threshold)"
|
||||
description = "Disk Utilization Forecast in percentage (recovery threshold)"
|
||||
type = "string"
|
||||
default = 72
|
||||
}
|
||||
|
||||
variable "disk_utilization_forecast_silenced" {
|
||||
description = "Groups to mute for GCP Cloud SQL Disk Utilization monitor"
|
||||
description = "Groups to mute for GCP Cloud SQL Disk Utilization Forecast monitor"
|
||||
type = "map"
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "disk_utilization_forecast_extra_tags" {
|
||||
description = "Extra tags for GCP Cloud SQL CPU Utilization monitor"
|
||||
description = "Extra tags for GCP Cloud SQL Disk Utilization Forecast monitor"
|
||||
type = "list"
|
||||
default = []
|
||||
}
|
||||
@ -228,16 +264,42 @@ variable "memory_utilization_forecast_timeframe" {
|
||||
default = "next_3d"
|
||||
}
|
||||
|
||||
variable "memory_utilization_forecast_algorithm" {
|
||||
description = "Algorithm for the Memory Utilization Forecast monitor"
|
||||
type = "string"
|
||||
default = "linear"
|
||||
}
|
||||
|
||||
variable "memory_utilization_forecast_deviations" {
|
||||
description = "Deviations for the Memory Utilization Forecast monitor"
|
||||
type = "string"
|
||||
default = 1
|
||||
}
|
||||
|
||||
variable "memory_utilization_forecast_interval" {
|
||||
description = "Interval for the Memory Utilization Forecast monitor"
|
||||
type = "string"
|
||||
default = "30m"
|
||||
}
|
||||
|
||||
variable "memory_utilization_forecast_history" {
|
||||
variable "memory_utilization_forecast_linear_history" {
|
||||
description = "History for the Memory Utilization Forecast monitor"
|
||||
type = "string"
|
||||
default = "12h"
|
||||
}
|
||||
|
||||
variable "memory_utilization_forecast_linear_model" {
|
||||
description = "Model for the Memory Utilization Forecast monitor"
|
||||
type = "string"
|
||||
default = "default"
|
||||
}
|
||||
|
||||
variable "memory_utilization_forecast_seasonal_seasonality" {
|
||||
description = "Seasonality for the Memory Utilization Forecast monitor"
|
||||
type = "string"
|
||||
default = "weekly"
|
||||
}
|
||||
|
||||
variable "memory_utilization_forecast_threshold_critical" {
|
||||
description = "Memory Utilization Forecast in percentage (warning threshold)"
|
||||
default = 90
|
||||
|
||||
@ -120,11 +120,11 @@ resource "datadog_monitor" "disk_utilization_forecast" {
|
||||
max(${var.disk_utilization_forecast_timeframe}):
|
||||
forecast(
|
||||
avg:gcp.cloudsql.database.disk.utilization{${data.template_file.filter.rendered}} by {database_id} * 100,
|
||||
'linear',
|
||||
1,
|
||||
interval='60m',
|
||||
history='3d',
|
||||
model='default'
|
||||
'${var.disk_utilization_forecast_algorithm}',
|
||||
${var.disk_utilization_forecast_deviations},
|
||||
interval='${var.disk_utilization_forecast_interval}',
|
||||
${var.disk_utilization_forecast_algorithm == "linear" ? format("history='%s',model='%s'", var.disk_utilization_forecast_linear_history, var.disk_utilization_forecast_linear_model): ""}
|
||||
${var.disk_utilization_forecast_algorithm == "seasonal" ? format("seasonality='%s'", var.disk_utilization_forecast_seasonal_seasonality): ""}
|
||||
)
|
||||
>= ${var.disk_utilization_forecast_threshold_critical}
|
||||
EOF
|
||||
@ -219,11 +219,11 @@ resource "datadog_monitor" "memory_utilization_forecast" {
|
||||
max(${var.memory_utilization_forecast_timeframe}):
|
||||
forecast(
|
||||
avg:gcp.cloudsql.database.memory.utilization{${data.template_file.filter.rendered}} by {database_id} * 100,
|
||||
'linear',
|
||||
1,
|
||||
'${var.memory_utilization_forecast_algorithm}',
|
||||
${var.memory_utilization_forecast_deviations},
|
||||
interval='${var.memory_utilization_forecast_interval}',
|
||||
history='${var.memory_utilization_forecast_history}',
|
||||
model='default'
|
||||
${var.memory_utilization_forecast_algorithm == "linear" ? format("history='%s',model='%s'", var.memory_utilization_forecast_linear_history, var.memory_utilization_forecast_linear_model): ""}
|
||||
${var.memory_utilization_forecast_algorithm == "seasonal" ? format("seasonality='%s'", var.memory_utilization_forecast_seasonal_seasonality): ""}
|
||||
)
|
||||
>= ${var.memory_utilization_forecast_threshold_critical}
|
||||
EOF
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user