MON-289 add dropped connections monitor

This commit is contained in:
Quentin Manfroi 2018-08-21 12:04:27 +02:00
parent 9d42d53494
commit 3984d31a87
2 changed files with 64 additions and 0 deletions

View File

@ -60,3 +60,38 @@ variable "nginx_connect_threshold_critical" {
type = "string"
default = "1.1754943508222875e-38"
}
variable "nginx_dropped_silenced" {
description = "Groups to mute for Nginx dropped connections monitor"
type = "map"
default = {}
}
variable "nginx_dropped_extra_tags" {
description = "Extra tags for Nginx dropped connections monitor"
type = "list"
default = []
}
variable "nginx_dropped_message" {
description = "Custom message for Nginx dropped connections monitor"
type = "string"
default = ""
}
variable "nginx_dropped_time_aggregator" {
description = "Monitor aggregator for Nginx dropped connections [available values: min, max or avg]"
type = "string"
default = "min"
}
variable "nginx_dropped_timeframe" {
description = "Monitor timeframe for Nginx dropped connections [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string"
default = "last_5m"
}
variable "nginx_dropped_threshold_critical" {
description = "php fpm busy critical threshold"
default = 0
}

View File

@ -27,3 +27,32 @@ resource "datadog_monitor" "datadog_nginx_process" {
tags = ["env:${var.environment}", "type:middleware", "provider:nginx", "resource:nginx", "team:claranet", "created-by:terraform", "${var.nginx_connect_extra_tags}"]
}
resource "datadog_monitor" "datadog_nginx_dropped_connections" {
name = "[${var.environment}] Nginx dropped connections {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = "${coalesce(var.nginx_dropped_message, var.message)}"
type = "metric alert"
query = "${var.nginx_dropped_time_aggregator}(${var.nginx_dropped_timeframe}):avg:nginx.net.conn_dropped_per_s${module.filter-tags.query_alert} by {host} > ${var.nginx_dropped_threshold_critical}"
thresholds {
warning = "${var.nginx_dropped_threshold_warning}"
critical = "${var.nginx_dropped_threshold_critical}"
}
notify_no_data = false
evaluation_delay = "${var.evaluation_delay}"
new_host_delay = "${var.new_host_delay}"
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
silenced = "${var.nginx_dropped_silenced}"
tags = ["env:${var.environment}", "type:middleware", "provider:nginx", "resource:nginx", "team:claranet", "created-by:terraform", "${var.nginx_dropped_extra_tags}"]
}