MON-110 add No Incoming Record firehose monitor
This commit is contained in:
parent
37d83aa0f2
commit
1bbc7c1e75
39
cloud/aws/kinesis-firehose/README.md
Normal file
39
cloud/aws/kinesis-firehose/README.md
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
AWS Kinesis Firehose DataDog monitors
|
||||||
|
==========================================
|
||||||
|
|
||||||
|
How to use this module
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
```
|
||||||
|
module "datadog-monitors-aws-firehose" {
|
||||||
|
source = "git::ssh://git@bitbucket.org/morea/terraform.feature.datadog.git//cloud/aws/kinesis-firehose?ref={revision}"
|
||||||
|
|
||||||
|
message = "${module.datadog-message-alerting.alerting-message}"
|
||||||
|
environment = "${var.environment}"
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Purpose
|
||||||
|
-------
|
||||||
|
Creates DataDog monitors with the following checks :
|
||||||
|
|
||||||
|
* No incoming record
|
||||||
|
|
||||||
|
Inputs
|
||||||
|
------
|
||||||
|
| Name | Description | Type | Default | Required |
|
||||||
|
|------|-------------|:----:|:-----:|:-----:|
|
||||||
|
| delay | Delay in seconds for the metric evaluation | string | `900` | no |
|
||||||
|
| environment | Environment | string | - | yes |
|
||||||
|
| 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 |
|
||||||
|
| incoming_records_timeframe | Monitor timeframe for incoming records metrics evaluation [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no |
|
||||||
|
| message | Message sent when an alert is triggered | string | - | yes |
|
||||||
|
|
||||||
|
Related documentation
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
DataDog documentation: [https://docs.datadoghq.com/integrations/amazon_firehose/](https://docs.datadoghq.com/integrations/amazon_firehose/)
|
||||||
|
|
||||||
|
AWS Kinesis Firehose metrics documentation: [https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/akf-metricscollected.html](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/akf-metricscollected.html)
|
||||||
31
cloud/aws/kinesis-firehose/inputs.tf
Normal file
31
cloud/aws/kinesis-firehose/inputs.tf
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# Global Terraform
|
||||||
|
variable "environment" {
|
||||||
|
description = "Environment"
|
||||||
|
type = "string"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Global DataDog
|
||||||
|
variable "delay" {
|
||||||
|
description = "Delay in seconds for the metric evaluation"
|
||||||
|
default = 900
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "message" {
|
||||||
|
description = "Message sent when an alert is triggered"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "filter_tags_use_defaults" {
|
||||||
|
description = "Use default filter tags convention"
|
||||||
|
default = "true"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "filter_tags_custom" {
|
||||||
|
description = "Tags used for custom filtering when filter_tags_use_defaults is false"
|
||||||
|
default = "*"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Kinesis-Firehose
|
||||||
|
variable "incoming_records_timeframe" {
|
||||||
|
description = "Monitor timeframe for incoming records metrics evaluation [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
|
||||||
|
default = "last_15m"
|
||||||
|
}
|
||||||
38
cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf
Normal file
38
cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
data "template_file" "filter" {
|
||||||
|
template = "$${filter}"
|
||||||
|
|
||||||
|
vars {
|
||||||
|
filter = "${var.filter_tags_use_defaults == "true" ? format("dd_monitoring:enabled,dd_aws_firehose:enabled,env:%s", var.environment) : "${var.filter_tags_custom}"}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
### Kinesis Firehose Incoming records ###
|
||||||
|
resource "datadog_monitor" "firehose_incoming_records" {
|
||||||
|
name = "[${var.environment}] Kinesis Firehose No incoming records"
|
||||||
|
message = "${var.message}"
|
||||||
|
|
||||||
|
type = "metric alert"
|
||||||
|
|
||||||
|
query = <<EOF
|
||||||
|
sum(${var.incoming_records_timeframe}): (
|
||||||
|
avg:aws.firehose.incoming_records{${data.template_file.filter.rendered}} by {region,deliverystreamname}
|
||||||
|
) <= 0
|
||||||
|
EOF
|
||||||
|
|
||||||
|
thresholds {
|
||||||
|
critical = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
notify_no_data = true
|
||||||
|
evaluation_delay = "${var.delay}"
|
||||||
|
renotify_interval = 0
|
||||||
|
notify_audit = false
|
||||||
|
timeout_h = 0
|
||||||
|
include_tags = true
|
||||||
|
locked = false
|
||||||
|
require_full_window = false
|
||||||
|
new_host_delay = "${var.delay}"
|
||||||
|
no_data_timeframe = 20
|
||||||
|
|
||||||
|
tags = ["env:${var.environment}", "resource:kinesis-firehose", "team:aws", "provider:aws"]
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user