MON-224 Automated readme and outputs
This commit is contained in:
parent
d0fe38e16d
commit
2e5ac912c1
@ -91,6 +91,10 @@ The `//` is very important, it's a terraform specific syntax used to separate gi
|
||||
- [sql-database](https://bitbucket.org/morea/terraform.feature.datadog/src/master/cloud/azure/sql-database/)
|
||||
- [storage](https://bitbucket.org/morea/terraform.feature.datadog/src/master/cloud/azure/storage/)
|
||||
- [stream-analytics](https://bitbucket.org/morea/terraform.feature.datadog/src/master/cloud/azure/stream-analytics/)
|
||||
- [gcp](https://bitbucket.org/morea/terraform.feature.datadog/src/master/cloud/gcp/)
|
||||
- [cloud-sql](https://bitbucket.org/morea/terraform.feature.datadog/src/master/cloud/gcp/cloud-sql/)
|
||||
- [instance](https://bitbucket.org/morea/terraform.feature.datadog/src/master/cloud/gcp/cloud-sql/instance/)
|
||||
- [mysql](https://bitbucket.org/morea/terraform.feature.datadog/src/master/cloud/gcp/cloud-sql/mysql/)
|
||||
- [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/)
|
||||
|
||||
@ -1,38 +1,28 @@
|
||||
GCP CloudSQL Instance Monitors
|
||||
==============================
|
||||
# CLOUD GCP CLOUD-SQL INSTANCE DataDog monitors
|
||||
|
||||
How to use this module
|
||||
----------------------
|
||||
## How to use this module
|
||||
|
||||
```
|
||||
module "datadog-monitors-gcp-cloudsql-instance" {
|
||||
module "datadog-monitors-cloud-gcp-cloud-sql-instance" {
|
||||
source = "git::ssh://git@bitbucket.org/morea/terraform.feature.datadog.git//cloud/gcp/cloud-sql/instance?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
|
||||
|
||||
* CloudSQL Instance CPU Utilization
|
||||
* CloudSQL Instance Disk Utilization
|
||||
* CloudSQL Instance Memory Utilization
|
||||
* CloudSQL Instance Memory Utilization Forecast
|
||||
* CloudSQL Instance Failover Unavailable
|
||||
Creates DataDog monitors with the following checks:
|
||||
|
||||
Useful links
|
||||
------------
|
||||
- Cloud SQL CPU Utilization
|
||||
- Cloud SQL Disk Utilization
|
||||
- Cloud SQL Memory Utilization
|
||||
- Cloud SQL Memory Utilization Forecast
|
||||
- Cloud SQL Failover Unavailable
|
||||
|
||||
* [GCP Metrics for CloudSQL](https://cloud.google.com/monitoring/api/metrics_gcp#gcp-cloudsql)
|
||||
* [Datadog Useful monitors for GCP CloudSQL](https://www.datadoghq.com/blog/monitor-google-cloud-sql/)
|
||||
|
||||
Inputs
|
||||
------
|
||||
## Inputs
|
||||
|
||||
| Name | Description | Type | Default | Required |
|
||||
|------|-------------|:----:|:-----:|:-----:|
|
||||
@ -74,3 +64,17 @@ Inputs
|
||||
| message | Message sent when a monitor is triggered | string | - | yes |
|
||||
| project_id | ID of the GCP Project | string | - | yes |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Name | Description |
|
||||
|------|-------------|
|
||||
| cpu_utilization_id | id for monitor cpu_utilization |
|
||||
| disk_utilization_id | id for monitor disk_utilization |
|
||||
| failover_unavailable_id | id for monitor failover_unavailable |
|
||||
| memory_utilization_forecast_id | id for monitor memory_utilization_forecast |
|
||||
| memory_utilization_id | id for monitor memory_utilization |
|
||||
|
||||
## Related documentation
|
||||
|
||||
* [GCP Metrics for CloudSQL](https://cloud.google.com/monitoring/api/metrics_gcp#gcp-cloudsql)
|
||||
* [Datadog Useful monitors for GCP CloudSQL](https://www.datadoghq.com/blog/monitor-google-cloud-sql/)
|
||||
|
||||
@ -15,7 +15,7 @@ data "template_file" "filter" {
|
||||
# CPU Utilization
|
||||
#
|
||||
resource "datadog_monitor" "cpu_utilization" {
|
||||
name = "[${var.environment}] Cloud SQL CPU utilization {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
|
||||
name = "[${var.environment}] Cloud SQL CPU Utilization {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
|
||||
message = "${coalesce(var.cpu_utilization_message, var.message)}"
|
||||
|
||||
type = "metric alert"
|
||||
@ -56,7 +56,7 @@ EOF
|
||||
# Disk Utilization
|
||||
#
|
||||
resource "datadog_monitor" "disk_utilization" {
|
||||
name = "[${var.environment}] Cloud SQL Disk utilization {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
|
||||
name = "[${var.environment}] Cloud SQL Disk Utilization {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
|
||||
message = "${coalesce(var.disk_utilization_message, var.message)}"
|
||||
|
||||
type = "metric alert"
|
||||
|
||||
@ -1,19 +1,24 @@
|
||||
output "cpu_utilization_id" {
|
||||
description = "id for monitor cpu_utilization"
|
||||
value = "${datadog_monitor.cpu_utilization.id}"
|
||||
}
|
||||
|
||||
output "disk_utilization_id" {
|
||||
description = "id for monitor disk_utilization"
|
||||
value = "${datadog_monitor.disk_utilization.id}"
|
||||
}
|
||||
|
||||
output "memory_utilization_id" {
|
||||
description = "id for monitor memory_utilization"
|
||||
value = "${datadog_monitor.memory_utilization.id}"
|
||||
}
|
||||
|
||||
output "memory_utilization_forecast_id" {
|
||||
description = "id for monitor memory_utilization_forecast"
|
||||
value = "${datadog_monitor.memory_utilization_forecast.id}"
|
||||
}
|
||||
|
||||
output "failover_unavailable_id" {
|
||||
description = "id for monitor failover_unavailable"
|
||||
value = "${datadog_monitor.failover_unavailable.id}"
|
||||
}
|
||||
|
||||
@ -1,40 +1,27 @@
|
||||
GCP CloudSQL MySQL Monitors
|
||||
==============================
|
||||
# CLOUD GCP CLOUD-SQL MYSQL DataDog monitors
|
||||
|
||||
How to use this module
|
||||
----------------------
|
||||
## How to use this module
|
||||
|
||||
```
|
||||
module "datadog-monitors-gcp-cloudsql-mysql" {
|
||||
module "datadog-monitors-cloud-gcp-cloud-sql-mysql" {
|
||||
source = "git::ssh://git@bitbucket.org/morea/terraform.feature.datadog.git//cloud/gcp/cloud-sql/mysql?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
|
||||
|
||||
* CloudSQL MySQL Network Connections
|
||||
* CloudSQL MySQL Replication Lag
|
||||
* CloudSQL MySQL Queries Changing Anomaly (not created by default)
|
||||
* CloudSQL MySQL Questions Changing Anomaly (not created by default)
|
||||
Creates DataDog monitors with the following checks:
|
||||
|
||||
Useful links
|
||||
------------
|
||||
- Cloud SQL MySQL Network Connections (hard limit: ${var.network_connections_hard_limit})
|
||||
- Cloud SQL MySQL Replication Lag too high
|
||||
- Cloud SQL MySQL Queries Count changed abnormally
|
||||
- Cloud SQL MySQL Questions Count changed abnormally
|
||||
|
||||
* [GCP Metrics for CloudSQL](https://cloud.google.com/monitoring/api/metrics_gcp#gcp-cloudsql)
|
||||
* [Datadog Useful monitors for GCP CloudSQL](https://www.datadoghq.com/blog/monitor-google-cloud-sql/)
|
||||
* [Max connections depends on the type of the instance](https://cloud.google.com/sql/docs/quotas#fixed-limits)
|
||||
* [Monitoring Replication Lag](https://cloud.google.com/sql/docs/mysql/high-availability#replication-lag-monitor)
|
||||
* [Monitoring MySQL Performance Metrics](https://www.datadoghq.com/blog/monitoring-mysql-performance-metrics)
|
||||
|
||||
Inputs
|
||||
------
|
||||
## Inputs
|
||||
|
||||
| Name | Description | Type | Default | Required |
|
||||
|------|-------------|:----:|:-----:|:-----:|
|
||||
@ -80,3 +67,19 @@ Inputs
|
||||
| replication_lag_threshold_warning | Seconds behind the master (warning threshold) | string | `300` | no |
|
||||
| replication_lag_timeframe | Timeframe for the Replication Lag monitor | string | `last_10m` | no |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Name | Description |
|
||||
|------|-------------|
|
||||
| network_connections_id | id for monitor network_connections |
|
||||
| queries_changing_anomaly_id | id for monitor queries_changing_anomaly |
|
||||
| questions_changing_anomaly_id | id for monitor questions_changing_anomaly |
|
||||
| replication_lag_id | id for monitor replication_lag |
|
||||
|
||||
## Related documentation
|
||||
|
||||
* [GCP Metrics for CloudSQL](https://cloud.google.com/monitoring/api/metrics_gcp#gcp-cloudsql)
|
||||
* [Datadog Useful monitors for GCP CloudSQL](https://www.datadoghq.com/blog/monitor-google-cloud-sql/)
|
||||
* [Max connections depends on the type of the instance](https://cloud.google.com/sql/docs/quotas#fixed-limits)
|
||||
* [Monitoring Replication Lag](https://cloud.google.com/sql/docs/mysql/high-availability#replication-lag-monitor)
|
||||
* [Monitoring MySQL Performance Metrics](https://www.datadoghq.com/blog/monitoring-mysql-performance-metrics)
|
||||
|
||||
@ -1,15 +1,19 @@
|
||||
output "network_connections_id" {
|
||||
description = "id for monitor network_connections"
|
||||
value = "${datadog_monitor.network_connections.id}"
|
||||
}
|
||||
|
||||
output "replication_lag_id" {
|
||||
description = "id for monitor replication_lag"
|
||||
value = "${datadog_monitor.replication_lag.id}"
|
||||
}
|
||||
|
||||
output "queries_changing_anomaly_id" {
|
||||
value = ["${datadog_monitor.queries_changing_anomaly.*.id}"]
|
||||
description = "id for monitor queries_changing_anomaly"
|
||||
value = "${datadog_monitor.queries_changing_anomaly.id}"
|
||||
}
|
||||
|
||||
output "questions_changing_anomaly_id" {
|
||||
value = ["${datadog_monitor.questions_changing_anomaly.*.id}"]
|
||||
description = "id for monitor questions_changing_anomaly"
|
||||
value = "${datadog_monitor.questions_changing_anomaly.id}"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user