Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework Azure flexible PostgreSQL detectors #463

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/severity.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,13 +483,13 @@

|Detector|Critical|Major|Minor|Warning|Info|
|---|---|---|---|---|---|
|Azure PostgreSQL heartbeat|X|-|-|-|-|
|Azure PostgreSQL CPU usage|X|X|-|-|-|
|Azure PostgreSQL has no connection|X|-|-|-|-|
|Azure PostgreSQL storage usage|X|X|-|-|-|
|Azure PostgreSQL IO consumption|X|X|-|-|-|
|Azure PostgreSQL memory usage |X|X|-|-|-|
||X|X|-|-|-|
|Azure PostgreSQL flexible heartbeat|X|-|-|-|-|
|Azure PostgreSQL flexible cpu usage|X|X|-|-|-|
|Azure PostgreSQL flexible has no connection|X|-|-|-|-|
|Azure PostgreSQL flexible storage usage|X|X|-|-|-|
|Azure PostgreSQL flexible disk iops consumption|X|X|-|-|-|
|Azure PostgreSQL flexible memory usage|X|X|-|-|-|
|Azure PostgreSQL flexible replication lag|X|X|-|-|-|


## integration_azure-functions
Expand Down
21 changes: 10 additions & 11 deletions modules/integration_azure-flexible-postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Note the following parameters:

These 3 parameters alongs with all variables defined in [common-variables.tf](common-variables.tf) are common to all
[modules](../) in this repository. Other variables, specific to this module, are available in
[variables.tf](variables.tf).
[variables-gen.tf](variables-gen.tf).
In general, the default configuration "works" but all of these Terraform
[variables](https://www.terraform.io/language/values/variables) make it possible to
customize the detectors behavior to better fit your needs.
Expand All @@ -75,13 +75,13 @@ This module creates the following SignalFx detectors which could contain one or

|Detector|Critical|Major|Minor|Warning|Info|
|---|---|---|---|---|---|
|Azure PostgreSQL heartbeat|X|-|-|-|-|
|Azure PostgreSQL CPU usage|X|X|-|-|-|
|Azure PostgreSQL has no connection|X|-|-|-|-|
|Azure PostgreSQL storage usage|X|X|-|-|-|
|Azure PostgreSQL IO consumption|X|X|-|-|-|
|Azure PostgreSQL memory usage |X|X|-|-|-|
||X|X|-|-|-|
|Azure PostgreSQL flexible heartbeat|X|-|-|-|-|
|Azure PostgreSQL flexible cpu usage|X|X|-|-|-|
|Azure PostgreSQL flexible has no connection|X|-|-|-|-|
|Azure PostgreSQL flexible storage usage|X|X|-|-|-|
|Azure PostgreSQL flexible disk iops consumption|X|X|-|-|-|
|Azure PostgreSQL flexible memory usage|X|X|-|-|-|
|Azure PostgreSQL flexible replication lag|X|X|-|-|-|

## How to collect required metrics?

Expand All @@ -101,10 +101,9 @@ Here is the list of required metrics for detectors in this module.

* `active_connections`
* `cpu_percent`
* `io_consumption_percent`
* `disk_iops_consumed_percentage`
* `memory_percent`
* `network_bytes_ingress`
* `serverlog_storage_percent`
* `physical_replication_delay_in_seconds`
* `storage_percent`


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
module: "Azure PostgreSQL flexible"
name: heartbeat

transformation: true
aggregation: true

filtering: "filter('resource_type', 'Microsoft.DB*orPostgreSQL/flexibleServers') and filter('primary_aggregation_type', 'true')"

signals:
signal:
metric: "cpu_percent"
rules:
critical:
...
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
module: "Azure PostgreSQL flexible"
name: "CPU usage"
filtering: "filter('resource_type', 'Microsoft.DB*orPostgreSQL/flexibleServers') and filter('primary_aggregation_type', 'true')"
aggregation: ".mean(by=['azure_resource_name', 'azure_resource_group_name', 'azure_region'])"
value_unit: "%"
transformation: true
signals:
signal:
metric: "cpu_percent"
rules:
critical:
threshold: 90
comparator: ">"
lasting_duration: '15m'
major:
threshold: 80
comparator: ">"
lasting_duration: '15m'
dependency: critical
...
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
id: no_connection
module: "Azure PostgreSQL flexible"
name: "has no connection"
filtering: "filter('resource_type', 'Microsoft.DB*orPostgreSQL/flexibleServers') and filter('primary_aggregation_type', 'true')"
aggregation: ".mean(by=['azure_resource_name', 'azure_resource_group_name', 'azure_region'])"
transformation: true
signals:
signal:
metric: "active_connections"
rules:
critical:
threshold: 1
comparator: "<"
lasting_duration: '15m'
...
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
module: "Azure PostgreSQL flexible"
name: "storage usage"
filtering: "filter('resource_type', 'Microsoft.DB*orPostgreSQL/flexibleServers') and filter('primary_aggregation_type', 'true')"
aggregation: ".mean(by=['azure_resource_name', 'azure_resource_group_name', 'azure_region'])"
value_unit: "%"
transformation: true
signals:
signal:
metric: "storage_percent"
rules:
critical:
threshold: 90
comparator: ">"
lasting_duration: '15m'
major:
threshold: 80
comparator: ">"
lasting_duration: '15m'
dependency: critical
...
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
id: io_consumption
module: "Azure PostgreSQL flexible"
name: "disk IOPS consumption"
filtering: "filter('resource_type', 'Microsoft.DB*orPostgreSQL/flexibleServers') and filter('primary_aggregation_type', 'true')"
aggregation: ".mean(by=['azure_resource_name', 'azure_resource_group_name', 'azure_region'])"
value_unit: "%"
transformation: true
signals:
signal:
metric: "disk_iops_consumed_percentage"
rules:
critical:
threshold: 90
comparator: ">"
lasting_duration: '15m'
major:
threshold: 80
comparator: ">"
lasting_duration: '15m'
dependency: critical
...
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
module: "Azure PostgreSQL flexible"
name: "memory usage"
filtering: "filter('resource_type', 'Microsoft.DB*orPostgreSQL/flexibleServers') and filter('primary_aggregation_type', 'true')"
aggregation: ".mean(by=['azure_resource_name', 'azure_resource_group_name', 'azure_region'])"
value_unit: "%"
transformation: true
signals:
signal:
metric: "memory_percent"
rules:
critical:
threshold: 90
comparator: ">"
lasting_duration: '15m'
major:
threshold: 80
comparator: ">"
lasting_duration: '15m'
dependency: critical
...
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
module: "Azure PostgreSQL flexible"
name: "replication lag"
filtering: "filter('resource_type', 'Microsoft.DB*orPostgreSQL/flexibleServers') and filter('primary_aggregation_type', 'true')"
aggregation: ".mean(by=['azure_resource_name', 'azure_resource_group_name', 'azure_region'])"
value_unit: s
transformation: ".max(over='15m')"
signals:
signal:
metric: "physical_replication_delay_in_seconds"
rules:
critical:
threshold: 200
comparator: ">"
lasting_duration: '15m'
major:
threshold: 100
comparator: ">"
lasting_duration: '15m'
dependency: critical
...
Loading