MON-402 Add Total connection threshold variables
This commit is contained in:
parent
2d0e9d33ce
commit
770d87c235
@ -22,7 +22,7 @@ Creates DataDog monitors with the following checks:
|
||||
- Mysql Server IO consumption
|
||||
- Mysql Server memory usage
|
||||
- Mysql Server storage
|
||||
- Mysql Server total connection reach 80 percent of the total limit
|
||||
- Mysql Server total connection reach
|
||||
|
||||
## Inputs
|
||||
|
||||
@ -68,9 +68,11 @@ Creates DataDog monitors with the following checks:
|
||||
| new\_host\_delay | Delay in seconds before monitor new resource | string | `"300"` | no |
|
||||
| total\_connection\_enabled | Flag to enable Mysql status monitor | string | `"true"` | no |
|
||||
| total\_connection\_extra\_tags | Extra tags for Mysql status monitor | list | `[]` | no |
|
||||
| total\_connection\_limit | Limit for Mysql total connection [See details : https://docs.microsoft.com/en-us/azure/mysql/concepts-limits] | string | `""` | no |
|
||||
| total\_connection\_limit | Limit for Mysql total connection [See details : https://docs.microsoft.com/en-us/azure/mysql/concepts-limits] | string | n/a | yes |
|
||||
| total\_connection\_message | Custom message for Mysql total connection monitor | string | `""` | no |
|
||||
| total\_connection\_silenced | Groups to mute for Mysql total connection monitor | map | `{}` | no |
|
||||
| total\_connection\_threshold\_critical | Mysql total connection threshold in percent (critical threshold) | string | `"80"` | no |
|
||||
| total\_connection\_threshold\_warning | Mysql total connection threshold in percent (warning threshold) | string | `"70"` | no |
|
||||
| total\_connection\_time\_aggregator | Monitor aggregator for Mysql total connection [available values: min, max or avg] | string | `"min"` | no |
|
||||
| total\_connection\_timeframe | Monitor timeframe for Mysql total connection [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no |
|
||||
|
||||
|
||||
@ -115,7 +115,16 @@ variable "total_connection_timeframe" {
|
||||
variable "total_connection_limit" {
|
||||
description = "Limit for Mysql total connection [See details : https://docs.microsoft.com/en-us/azure/mysql/concepts-limits]"
|
||||
type = "string"
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "total_connection_threshold_warning" {
|
||||
description = "Mysql total connection threshold in percent (warning threshold)"
|
||||
default = "70"
|
||||
}
|
||||
|
||||
variable "total_connection_threshold_critical" {
|
||||
description = "Mysql total connection threshold in percent (critical threshold)"
|
||||
default = "80"
|
||||
}
|
||||
|
||||
variable "free_storage_silenced" {
|
||||
|
||||
@ -33,17 +33,22 @@ resource "datadog_monitor" "mysql_cpu_usage" {
|
||||
|
||||
resource "datadog_monitor" "mysql_total_connection" {
|
||||
count = "${var.total_connection_enabled ? 1 : 0}"
|
||||
name = "[${var.environment}] Mysql Server total connection reach 80 percent of the total limit"
|
||||
name = "[${var.environment}] Mysql Server total connection reach {{#is_alert}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}} {{warn_threshold}}% ({{value}}%){{/is_warning}} of the total limit"
|
||||
message = "${coalesce(var.total_connection_message, var.message)}"
|
||||
|
||||
query = <<EOF
|
||||
${var.total_connection_time_aggregator}(${var.total_connection_timeframe}): (
|
||||
avg:azure.dbformysql_servers.active_connections${module.filter-tags.query_alert} by {resource_group,region,name} / ${var.total_connection_limit}
|
||||
) * 100 > 80
|
||||
) * 100 > "${var.total_connection_threshold_critical}"
|
||||
EOF
|
||||
|
||||
type = "metric alert"
|
||||
|
||||
thresholds {
|
||||
critical = "${var.total_connection_threshold_critical}"
|
||||
warning = "${var.total_connection_threshold_warning}"
|
||||
}
|
||||
|
||||
silenced = "${var.total_connection_silenced}"
|
||||
|
||||
notify_no_data = true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user