Skip to content

Commit

Permalink
Fix integration_azure-mariadb (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
zfiel authored Mar 24, 2022
1 parent 3608ee5 commit b081999
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion modules/integration_azure-mariadb/conf/00-heartbeat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: heartbeat
transformation: true
aggregation: ".mean(by=['azure_resource_id'])"

filtering: "filter('resource_type', 'Microsoft.DBforMariaDB/servers') and filter('primary_aggregation_type', 'true')"
filtering: "filter('resource_type', 'Microsoft.DB*orMariaDB/servers') and filter('primary_aggregation_type', 'true')"

signals:
signal:
Expand Down
2 changes: 1 addition & 1 deletion modules/integration_azure-mariadb/conf/01-cpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: "CPU usage"
transformation: true
aggregation: ".mean(by=['azure_resource_name', 'azure_resource_group_name', 'azure_region'])"

filtering: "filter('resource_type', 'Microsoft.DBforMariaDB/servers') and filter('primary_aggregation_type', 'true')"
filtering: "filter('resource_type', 'Microsoft.DB*orMariaDB/servers') and filter('primary_aggregation_type', 'true')"
value_unit: "%"

signals:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: "Storage usage"
transformation: true
aggregation: ".mean(by=['azure_resource_name', 'azure_resource_group_name', 'azure_region'])"

filtering: "filter('resource_type', 'Microsoft.DBforMariaDB/servers') and filter('primary_aggregation_type', 'true')"
filtering: "filter('resource_type', 'Microsoft.DB*orMariaDB/servers') and filter('primary_aggregation_type', 'true')"
value_unit: "%"

signals:
Expand Down
2 changes: 1 addition & 1 deletion modules/integration_azure-mariadb/conf/03-io-conso.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: "IO consumption"
transformation: true
aggregation: ".mean(by=['azure_resource_name', 'azure_resource_group_name', 'azure_region'])"

filtering: "filter('resource_type', 'Microsoft.DBforMariaDB/servers') and filter('primary_aggregation_type', 'true')"
filtering: "filter('resource_type', 'Microsoft.DB*orMariaDB/servers') and filter('primary_aggregation_type', 'true')"
value_unit: "%"

signals:
Expand Down
2 changes: 1 addition & 1 deletion modules/integration_azure-mariadb/conf/04-memory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: "Memory usage"
transformation: true
aggregation: ".mean(by=['azure_resource_name', 'azure_resource_group_name', 'azure_region'])"

filtering: "filter('resource_type', 'Microsoft.DBforMariaDB/servers') and filter('primary_aggregation_type', 'true')"
filtering: "filter('resource_type', 'Microsoft.DB*orMariaDB/servers') and filter('primary_aggregation_type', 'true')"
value_unit: "%"

signals:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: "replication lag"
transformation: true
aggregation: ".mean(by=['azure_resource_name', 'azure_resource_group_name', 'azure_region'])"

filtering: "filter('resource_type', 'Microsoft.DBforMariaDB/servers') and filter('primary_aggregation_type', 'true')"
filtering: "filter('resource_type', 'Microsoft.DB*orMariaDB/servers') and filter('primary_aggregation_type', 'true')"
value_unit: "Second"

signals:
Expand Down
12 changes: 6 additions & 6 deletions modules/integration_azure-mariadb/detectors-gen.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resource "signalfx_detector" "heartbeat" {

program_text = <<-EOF
from signalfx.detectors.not_reporting import not_reporting
base_filtering = filter('resource_type', 'Microsoft.DBforMariaDB/servers') and filter('primary_aggregation_type', 'true')
base_filtering = filter('resource_type', 'Microsoft.DB*orMariaDB/servers') and filter('primary_aggregation_type', 'true')
signal = data('active_connections', filter=base_filtering and ${module.filtering.signalflow})${var.heartbeat_aggregation_function}${var.heartbeat_transformation_function}.publish('signal')
not_reporting.detector(stream=signal, resource_identifier=None, duration='${var.heartbeat_timeframe}', auto_resolve_after='${local.heartbeat_auto_resolve_after}').publish('CRIT')
EOF
Expand Down Expand Up @@ -40,7 +40,7 @@ resource "signalfx_detector" "cpu" {
}

program_text = <<-EOF
base_filtering = filter('resource_type', 'Microsoft.DBforMariaDB/servers') and filter('primary_aggregation_type', 'true')
base_filtering = filter('resource_type', 'Microsoft.DB*orMariaDB/servers') and filter('primary_aggregation_type', 'true')
signal = data('cpu_percent', filter=base_filtering and ${module.filtering.signalflow})${var.cpu_aggregation_function}${var.cpu_transformation_function}.publish('signal')
detect(when(signal > ${var.cpu_threshold_major}, lasting=%{if var.cpu_lasting_duration_major == null}None%{else}'${var.cpu_lasting_duration_major}'%{endif}, at_least=${var.cpu_at_least_percentage_major})).publish('MAJOR')
detect(when(signal > ${var.cpu_threshold_critical}, lasting=%{if var.cpu_lasting_duration_critical == null}None%{else}'${var.cpu_lasting_duration_critical}'%{endif}, at_least=${var.cpu_at_least_percentage_critical}) and (not when(signal > ${var.cpu_threshold_major}, lasting=%{if var.cpu_lasting_duration_major == null}None%{else}'${var.cpu_lasting_duration_major}'%{endif}, at_least=${var.cpu_at_least_percentage_major}))).publish('CRIT')
Expand Down Expand Up @@ -86,7 +86,7 @@ resource "signalfx_detector" "storage" {
}

program_text = <<-EOF
base_filtering = filter('resource_type', 'Microsoft.DBforMariaDB/servers') and filter('primary_aggregation_type', 'true')
base_filtering = filter('resource_type', 'Microsoft.DB*orMariaDB/servers') and filter('primary_aggregation_type', 'true')
signal = data('storage_percent', filter=base_filtering and ${module.filtering.signalflow})${var.storage_aggregation_function}${var.storage_transformation_function}.publish('signal')
detect(when(signal > ${var.storage_threshold_major}, lasting=%{if var.storage_lasting_duration_major == null}None%{else}'${var.storage_lasting_duration_major}'%{endif}, at_least=${var.storage_at_least_percentage_major})).publish('MAJOR')
detect(when(signal > ${var.storage_threshold_critical}, lasting=%{if var.storage_lasting_duration_critical == null}None%{else}'${var.storage_lasting_duration_critical}'%{endif}, at_least=${var.storage_at_least_percentage_critical}) and (not when(signal > ${var.storage_threshold_major}, lasting=%{if var.storage_lasting_duration_major == null}None%{else}'${var.storage_lasting_duration_major}'%{endif}, at_least=${var.storage_at_least_percentage_major}))).publish('CRIT')
Expand Down Expand Up @@ -132,7 +132,7 @@ resource "signalfx_detector" "io" {
}

program_text = <<-EOF
base_filtering = filter('resource_type', 'Microsoft.DBforMariaDB/servers') and filter('primary_aggregation_type', 'true')
base_filtering = filter('resource_type', 'Microsoft.DB*orMariaDB/servers') and filter('primary_aggregation_type', 'true')
signal = data('io_consumption_percent', filter=base_filtering and ${module.filtering.signalflow})${var.io_aggregation_function}${var.io_transformation_function}.publish('signal')
detect(when(signal > ${var.io_threshold_major}, lasting=%{if var.io_lasting_duration_major == null}None%{else}'${var.io_lasting_duration_major}'%{endif}, at_least=${var.io_at_least_percentage_major})).publish('MAJOR')
detect(when(signal > ${var.io_threshold_critical}, lasting=%{if var.io_lasting_duration_critical == null}None%{else}'${var.io_lasting_duration_critical}'%{endif}, at_least=${var.io_at_least_percentage_critical}) and (not when(signal > ${var.io_threshold_major}, lasting=%{if var.io_lasting_duration_major == null}None%{else}'${var.io_lasting_duration_major}'%{endif}, at_least=${var.io_at_least_percentage_major}))).publish('CRIT')
Expand Down Expand Up @@ -178,7 +178,7 @@ resource "signalfx_detector" "memory" {
}

program_text = <<-EOF
base_filtering = filter('resource_type', 'Microsoft.DBforMariaDB/servers') and filter('primary_aggregation_type', 'true')
base_filtering = filter('resource_type', 'Microsoft.DB*orMariaDB/servers') and filter('primary_aggregation_type', 'true')
signal = data('memory_percent', filter=base_filtering and ${module.filtering.signalflow})${var.memory_aggregation_function}${var.memory_transformation_function}.publish('signal')
detect(when(signal > ${var.memory_threshold_major}, lasting=%{if var.memory_lasting_duration_major == null}None%{else}'${var.memory_lasting_duration_major}'%{endif}, at_least=${var.memory_at_least_percentage_major})).publish('MAJOR')
detect(when(signal > ${var.memory_threshold_critical}, lasting=%{if var.memory_lasting_duration_critical == null}None%{else}'${var.memory_lasting_duration_critical}'%{endif}, at_least=${var.memory_at_least_percentage_critical}) and (not when(signal > ${var.memory_threshold_major}, lasting=%{if var.memory_lasting_duration_major == null}None%{else}'${var.memory_lasting_duration_major}'%{endif}, at_least=${var.memory_at_least_percentage_major}))).publish('CRIT')
Expand Down Expand Up @@ -224,7 +224,7 @@ resource "signalfx_detector" "replication_lag" {
}

program_text = <<-EOF
base_filtering = filter('resource_type', 'Microsoft.DBforMariaDB/servers') and filter('primary_aggregation_type', 'true')
base_filtering = filter('resource_type', 'Microsoft.DB*orMariaDB/servers') and filter('primary_aggregation_type', 'true')
signal = data('seconds_behind_master', filter=base_filtering and ${module.filtering.signalflow})${var.replication_lag_aggregation_function}${var.replication_lag_transformation_function}.publish('signal')
detect(when(signal > ${var.replication_lag_threshold_major}, lasting=%{if var.replication_lag_lasting_duration_major == null}None%{else}'${var.replication_lag_lasting_duration_major}'%{endif}, at_least=${var.replication_lag_at_least_percentage_major})).publish('MAJOR')
detect(when(signal > ${var.replication_lag_threshold_critical}, lasting=%{if var.replication_lag_lasting_duration_critical == null}None%{else}'${var.replication_lag_lasting_duration_critical}'%{endif}, at_least=${var.replication_lag_at_least_percentage_critical}) and (not when(signal > ${var.replication_lag_threshold_major}, lasting=%{if var.replication_lag_lasting_duration_major == null}None%{else}'${var.replication_lag_lasting_duration_major}'%{endif}, at_least=${var.replication_lag_at_least_percentage_major}))).publish('CRIT')
Expand Down

0 comments on commit b081999

Please sign in to comment.