Merged in MON-289-monitors-for-nginx (pull request #149)

MON-289 make nginx check more tolerant

Approved-by: Quentin Manfroi <quentin.manfroi@yahoo.fr>
Approved-by: Rafael Romero Carmona <rafael.romero.carmona@fr.clara.net>
Approved-by: GL <glaloum@morea.fr>
Approved-by: Adrien Broyere <adrien.broyere@fr.clara.net>
Approved-by: Jean-Philippe LAINÉ <jean-philippe.laine@fr.clara.net>
This commit is contained in:
Quentin Manfroi 2018-09-14 12:59:09 +00:00
commit 2226b5583b
3 changed files with 15 additions and 7 deletions

View File

@ -32,8 +32,9 @@ Creates DataDog monitors with the following checks:
| nginx_connect_enabled | Flag to enable Nginx status monitor | string | `true` | no |
| nginx_connect_extra_tags | Extra tags for Nginx process monitor | list | `<list>` | no |
| nginx_connect_message | Custom message for Nginx status monitor | string | `` | no |
| nginx_connect_no_data_timeframe | Nginx status monitor no data timeframe | string | `10` | no |
| nginx_connect_silenced | Groups to mute for Nginx status monitor | map | `<map>` | no |
| nginx_connect_threshold_critical | Nginx status monitor (critical threshold) | string | `1.1754943508222875e-38` | no |
| nginx_connect_threshold_warning | Nginx status monitor (warning threshold) | string | `3` | no |
| nginx_dropped_extra_tags | Extra tags for Nginx dropped connections monitor | list | `<list>` | no |
| nginx_dropped_message | Custom message for Nginx dropped connections monitor | string | `` | no |
| nginx_dropped_silenced | Groups to mute for Nginx dropped connections monitor | map | `<map>` | no |

View File

@ -55,10 +55,16 @@ variable "nginx_connect_message" {
default = ""
}
variable "nginx_connect_threshold_critical" {
description = "Nginx status monitor (critical threshold)"
variable "nginx_connect_threshold_warning" {
description = "Nginx status monitor (warning threshold)"
type = "string"
default = "1.1754943508222875e-38"
default = 3
}
variable "nginx_connect_no_data_timeframe" {
description = "Nginx status monitor no data timeframe"
type = "string"
default = 10
}
variable "nginx_dropped_silenced" {

View File

@ -6,15 +6,16 @@ resource "datadog_monitor" "datadog_nginx_process" {
type = "service check"
query = <<EOF
"nginx.can_connect".over${module.filter-tags.service_check}.by("host","port","server").last(1).pct_by_status()
"nginx.can_connect".over${module.filter-tags.service_check}.by("server","port").last(6).count_by_status()
EOF
thresholds = {
warning = 0
critical = "${var.nginx_connect_threshold_critical}"
warning = "${var.nginx_connect_threshold_warning}"
critical = 5
}
notify_no_data = true
no_data_timeframe = "${var.nginx_connect_no_data_timeframe}"
new_host_delay = "${var.new_host_delay}"
renotify_interval = 0
notify_audit = false