From cd0feccf5932a46670a552ab82fd3626805e5187 Mon Sep 17 00:00:00 2001 From: Rafael Romero Carmona Date: Wed, 1 Aug 2018 14:42:23 +0200 Subject: [PATCH] MON-226 Auto readme and outputs for the basic monitors --- README.md | 1 + cloud/gcp/pubsub/README.md | 48 +++++++++++++++++++++++++++++-------- cloud/gcp/pubsub/outputs.tf | 9 +++++++ 3 files changed, 48 insertions(+), 10 deletions(-) create mode 100644 cloud/gcp/pubsub/outputs.tf diff --git a/README.md b/README.md index 72455ee..db806cc 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ The `//` is very important, it's a terraform specific syntax used to separate gi - [cloud-sql](https://bitbucket.org/morea/terraform.feature.datadog/src/master/cloud/gcp/cloud-sql/) - [common](https://bitbucket.org/morea/terraform.feature.datadog/src/master/cloud/gcp/cloud-sql/common/) - [mysql](https://bitbucket.org/morea/terraform.feature.datadog/src/master/cloud/gcp/cloud-sql/mysql/) + - [pubsub](https://bitbucket.org/morea/terraform.feature.datadog/src/master/cloud/gcp/pubsub/) - [common](https://bitbucket.org/morea/terraform.feature.datadog/src/master/common/) - [alerting-message](https://bitbucket.org/morea/terraform.feature.datadog/src/master/common/alerting-message/) - [filter-tags](https://bitbucket.org/morea/terraform.feature.datadog/src/master/common/filter-tags/) diff --git a/cloud/gcp/pubsub/README.md b/cloud/gcp/pubsub/README.md index a7cc282..73e1076 100644 --- a/cloud/gcp/pubsub/README.md +++ b/cloud/gcp/pubsub/README.md @@ -1,26 +1,54 @@ -How to use this module ----------------------- +# CLOUD GCP PUBSUB DataDog monitors + +## How to use this module ``` -module "datadog-monitors-gcp-pubsub" { +module "datadog-monitors-cloud-gcp-pubsub" { source = "git::ssh://git@bitbucket.org/morea/terraform.feature.datadog.git//cloud/gcp/pubsub?ref={revision}" - project_id = "${var.gcp_project_id}" environment = "${var.environment}" message = "${module.datadog-message-alerting.alerting-message}" } ``` -Purpose -------- -Creates DataDog monitors with the following checks : +## Purpose -* +Creates DataDog monitors with the following checks: -Inputs ------- +- GCP pubsub sending messages operations +- GCP pubsub sending messages with result unavailable +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|:----:|:-----:|:-----:| +| delay | Delay in seconds for the metric evaluation | string | `900` | no | +| environment | Architecture 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 | +| message | Message sent when a monitor is triggered | string | - | yes | +| project_id | ID of the GCP Project | string | - | yes | +| sending_operations_count_extra_tags | Extra tags for GCP Pub/Sub Sending Operations Count monitor | list | `` | no | +| sending_operations_count_message | Custom message for the GCP Pub/Sub Sending Operations Count monitor | string | `` | no | +| sending_operations_count_silenced | Groups to mute for GCP Pub/Sub Sending Operations Count monitor | map | `` | no | +| sending_operations_count_threshold_critical | Critical threshold | string | `0` | no | +| sending_operations_count_time_aggregator | Timeframe for the GCP Pub/Sub Sending Operations Count monitor | string | `sum` | no | +| sending_operations_count_timeframe | Timeframe for the GCP Pub/Sub Sending Operations Count monitor | string | `last_30m` | no | +| unavailable_sending_operations_count_extra_tags | Extra tags for GCP Pub/Sub Unavailable Sending Operations Count monitor | list | `` | no | +| unavailable_sending_operations_count_message | Custom message for the GCP Pub/Sub Unavailable Sending Operations Count monitor | string | `` | no | +| unavailable_sending_operations_count_silenced | Groups to mute for GCP Pub/Sub Unavailable Sending Operations Count monitor | map | `` | no | +| unavailable_sending_operations_count_threshold_critical | Critical threshold | string | `4` | no | +| unavailable_sending_operations_count_threshold_warning | Warning threshold | string | `2` | no | +| unavailable_sending_operations_count_time_aggregator | Timeframe for the GCP Pub/Sub Unavailable Sending Operations Count monitor | string | `sum` | no | +| unavailable_sending_operations_count_timeframe | Timeframe for the GCP Pub/Sub Unavailable Sending Operations Count monitor | string | `last_10m` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| sending_operations_count_id | id for monitor sending_operations_count | +| unavailable_sending_operations_count_id | id for monitor unavailable_sending_operations_count | Related documentation ------------ diff --git a/cloud/gcp/pubsub/outputs.tf b/cloud/gcp/pubsub/outputs.tf new file mode 100644 index 0000000..869f4b8 --- /dev/null +++ b/cloud/gcp/pubsub/outputs.tf @@ -0,0 +1,9 @@ +output "sending_operations_count_id" { + description = "id for monitor sending_operations_count" + value = "${datadog_monitor.sending_operations_count.*.id}" +} + +output "unavailable_sending_operations_count_id" { + description = "id for monitor unavailable_sending_operations_count" + value = "${datadog_monitor.unavailable_sending_operations_count.*.id}" +}