MON-191 - PHP FPM monitors updated with customizable aggregator

This commit is contained in:
Alexandre Gaillet 2018-04-30 15:35:26 +02:00 committed by Quentin Manfroi
parent e2797f7d71
commit 5bd3cab9ba
3 changed files with 11 additions and 4 deletions

View File

@ -30,6 +30,7 @@ Inputs
| filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | | filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no |
| filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no |
| message | Message sent when an alert is triggered | string | - | yes | | message | Message sent when an alert is triggered | string | - | yes |
| php_fpm_busy_aggregator | Monitor aggregator for PHP FPM busy worker [available values: min, max, sum or avg] | string | `avg` | no |
| php_fpm_busy_message | Custom message for PHP FPM busy worker monitor | string | `` | no | | php_fpm_busy_message | Custom message for PHP FPM busy worker monitor | string | `` | no |
| php_fpm_busy_silenced | Groups to mute for PHP FPM busy worker monitor | map | `<map>` | no | | php_fpm_busy_silenced | Groups to mute for PHP FPM busy worker monitor | map | `<map>` | no |
| php_fpm_busy_threshold_critical | php fpm busy critical threshold | string | `0.9` | no | | php_fpm_busy_threshold_critical | php fpm busy critical threshold | string | `0.9` | no |

View File

@ -38,6 +38,12 @@ variable "php_fpm_busy_message" {
default = "" default = ""
} }
variable "php_fpm_busy_aggregator" {
description = "Monitor aggregator for PHP FPM busy worker [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "php_fpm_busy_timeframe" { variable "php_fpm_busy_timeframe" {
description = "Monitor timeframe for PHP FPM busy worker [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for PHP FPM busy worker [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string" type = "string"

View File

@ -13,10 +13,10 @@ resource "datadog_monitor" "datadog_php_fpm_connect_idle" {
type = "metric alert" type = "metric alert"
query = <<EOF query = <<EOF
avg(${var.php_fpm_busy_timeframe}): ( ${var.php_fpm_busy_aggregator}(${var.php_fpm_busy_timeframe}): (
avg:php_fpm.processes.active{${data.template_file.filter.rendered}} by {region, host} / ${var.php_fpm_busy_aggregator}:php_fpm.processes.active{${data.template_file.filter.rendered}} by {region, host} /
( avg:php_fpm.processes.idle{${data.template_file.filter.rendered}} by {region, host} + ( ${var.php_fpm_busy_aggregator}:php_fpm.processes.idle{${data.template_file.filter.rendered}} by {region, host} +
avg:php_fpm.processes.active{${data.template_file.filter.rendered}} by {region, host} ) ${var.php_fpm_busy_aggregator}:php_fpm.processes.active{${data.template_file.filter.rendered}} by {region, host} )
) > ${var.php_fpm_busy_threshold_critical} ) > ${var.php_fpm_busy_threshold_critical}
EOF EOF