|
| 1 | +# GCP-CLOUD-SQL-POSTGRESQL SignalFx detectors |
| 2 | + |
| 3 | +<!-- START doctoc generated TOC please keep comment here to allow auto update --> |
| 4 | +<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
| 5 | +:link: **Contents** |
| 6 | + |
| 7 | +- [How to use this module?](#how-to-use-this-module) |
| 8 | +- [What are the available detectors in this module?](#what-are-the-available-detectors-in-this-module) |
| 9 | +- [How to collect required metrics?](#how-to-collect-required-metrics) |
| 10 | + - [Metrics](#metrics) |
| 11 | +- [Related documentation](#related-documentation) |
| 12 | + |
| 13 | +<!-- END doctoc generated TOC please keep comment here to allow auto update --> |
| 14 | + |
| 15 | +## How to use this module? |
| 16 | + |
| 17 | +This directory defines a [Terraform](https://www.terraform.io/) |
| 18 | +[module](https://www.terraform.io/language/modules/syntax) you can use in your |
| 19 | +existing [stack](https://github.com/claranet/terraform-signalfx-detectors/wiki/Getting-started#stack) by adding a |
| 20 | +`module` configuration and setting its `source` parameter to URL of this folder: |
| 21 | + |
| 22 | +```hcl |
| 23 | +module "signalfx-detectors-integration-gcp-cloud-sql-postgresql" { |
| 24 | + source = "github.com/claranet/terraform-signalfx-detectors.git//modules/integration_gcp-cloud-sql-postgresql?ref={revision}" |
| 25 | +
|
| 26 | + environment = var.environment |
| 27 | + notifications = local.notifications |
| 28 | + gcp_project_id = "fillme" |
| 29 | +} |
| 30 | +``` |
| 31 | + |
| 32 | +Note the following parameters: |
| 33 | + |
| 34 | +* `source`: Use this parameter to specify the URL of the module. The double slash (`//`) is intentional and required. |
| 35 | + Terraform uses it to specify subfolders within a Git repo (see [module |
| 36 | + sources](https://www.terraform.io/language/modules/sources)). The `ref` parameter specifies a specific Git tag in |
| 37 | + this repository. It is recommended to use the latest "pinned" version in place of `{revision}`. Avoid using a branch |
| 38 | + like `master` except for testing purpose. Note that every modules in this repository are available on the Terraform |
| 39 | + [registry](https://registry.terraform.io/modules/claranet/detectors/signalfx) and we recommend using it as source |
| 40 | + instead of `git` which is more flexible but less future-proof. |
| 41 | + |
| 42 | +* `environment`: Use this parameter to specify the |
| 43 | + [environment](https://github.com/claranet/terraform-signalfx-detectors/wiki/Getting-started#environment) used by this |
| 44 | + instance of the module. |
| 45 | + Its value will be added to the `prefixes` list at the start of the [detector |
| 46 | + name](https://github.com/claranet/terraform-signalfx-detectors/wiki/Templating#example). |
| 47 | + In general, it will also be used in the `filtering` internal sub-module to [apply |
| 48 | + filters](https://github.com/claranet/terraform-signalfx-detectors/wiki/Guidance#filtering) based on our default |
| 49 | + [tagging convention](https://github.com/claranet/terraform-signalfx-detectors/wiki/Tagging-convention) by default. |
| 50 | + |
| 51 | +* `notifications`: Use this parameter to define where alerts should be sent depending on their severity. It consists |
| 52 | + of a Terraform [object](https://www.terraform.io/language/expressions/type-constraints#object) where each key represents an available |
| 53 | + [detector rule severity](https://docs.splunk.com/observability/alerts-detectors-notifications/create-detectors-for-alerts.html#severity) |
| 54 | + and its value is a list of recipients. Every recipients must respect the [detector notification |
| 55 | + format](https://registry.terraform.io/providers/splunk-terraform/signalfx/latest/docs/resources/detector#notification-format). |
| 56 | + Check the [notification binding](https://github.com/claranet/terraform-signalfx-detectors/wiki/Notifications-binding) |
| 57 | + documentation to understand the recommended role of each severity. |
| 58 | + |
| 59 | +These 3 parameters along with all variables defined in [common-variables.tf](common-variables.tf) are common to all |
| 60 | +[modules](../) in this repository. Other variables, specific to this module, are available in |
| 61 | +[variables.tf](variables.tf) and [variables-gen.tf](variables-gen.tf). |
| 62 | +In general, the default configuration "works" but all of these Terraform |
| 63 | +[variables](https://www.terraform.io/language/values/variables) make it possible to |
| 64 | +customize the detectors behavior to better fit your needs. |
| 65 | + |
| 66 | +Most of them represent usual tips and rules detailed in the |
| 67 | +[guidance](https://github.com/claranet/terraform-signalfx-detectors/wiki/Guidance) documentation and listed in the |
| 68 | +common [variables](https://github.com/claranet/terraform-signalfx-detectors/wiki/Variables) dedicated documentation. |
| 69 | + |
| 70 | +Feel free to explore the [wiki](https://github.com/claranet/terraform-signalfx-detectors/wiki) for more information about |
| 71 | +general usage of this repository. |
| 72 | + |
| 73 | +## What are the available detectors in this module? |
| 74 | + |
| 75 | +This module creates the following SignalFx detectors which could contain one or multiple alerting rules: |
| 76 | + |
| 77 | +|Detector|Critical|Major|Minor|Warning|Info| |
| 78 | +|---|---|---|---|---|---| |
| 79 | +|GCP Cloud SQL PostgreSQL replication lag|X|X|-|-|-| |
| 80 | + |
| 81 | +## How to collect required metrics? |
| 82 | + |
| 83 | +This module deploys detectors using metrics reported by the |
| 84 | +[GCP integration](https://docs.splunk.com/observability/en/gdi/get-data-in/connect/gcp/gcp-metrics.html) configurable |
| 85 | +with [this Terraform module](https://github.com/claranet/terraform-signalfx-integrations/tree/master/cloud/gcp). |
| 86 | + |
| 87 | + |
| 88 | +Check the [Related documentation](#related-documentation) section for more detailed and specific information about this module dependencies. |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | +### Metrics |
| 93 | + |
| 94 | + |
| 95 | +Here is the list of required metrics for detectors in this module. |
| 96 | + |
| 97 | +* `database/postgresql/replication/replica_byte_lag` |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | +## Related documentation |
| 103 | + |
| 104 | +* [Terraform SignalFx provider](https://registry.terraform.io/providers/splunk-terraform/signalfx/latest/docs) |
| 105 | +* [Terraform SignalFx detector](https://registry.terraform.io/providers/splunk-terraform/signalfx/latest/docs/resources/detector) |
| 106 | +* [Splunk Observability integrations](https://docs.splunk.com/Observability/gdi/get-data-in/integrations.html) |
| 107 | +* [Stackdriver metrics](https://cloud.google.com/monitoring/api/metrics_gcp#gcp-cloudsql) |
0 commit comments