From 014e03f31085abecb6712f3cdd57d8d2cf3cb7e4 Mon Sep 17 00:00:00 2001 From: matoy Date: Mon, 17 May 2021 17:27:02 +0200 Subject: [PATCH 01/10] Update connections.pm fix ; $metric_type (servers, flexibleServers) don't exist in $metrics_mapping hash (active_connections, connections_failed) same bug in several modes of this plugin. --- cloud/azure/database/mysql/mode/connections.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/database/mysql/mode/connections.pm b/cloud/azure/database/mysql/mode/connections.pm index 48d0e6a28..66e341d5e 100644 --- a/cloud/azure/database/mysql/mode/connections.pm +++ b/cloud/azure/database/mysql/mode/connections.pm @@ -123,7 +123,7 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - $metrics_mapping_transformed->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; + $metrics_mapping_transformed->{$metric_type} = $self->{resource_mapping}->{$metric_type}; } foreach my $metric (keys %{$self->{metrics_mapping_transformed}}) { From 9a2a4d24cd721bb8c10eaa4df790a8092b685f4d Mon Sep 17 00:00:00 2001 From: matoy Date: Mon, 17 May 2021 17:30:20 +0200 Subject: [PATCH 02/10] Update replication.pm --- cloud/azure/database/mysql/mode/replication.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/database/mysql/mode/replication.pm b/cloud/azure/database/mysql/mode/replication.pm index ea1c89602..7a56d4ad6 100644 --- a/cloud/azure/database/mysql/mode/replication.pm +++ b/cloud/azure/database/mysql/mode/replication.pm @@ -109,7 +109,7 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - $metrics_mapping_transformed->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; + $metrics_mapping_transformed->{$metric_type} = $self->{resource_mapping}->{$metric_type}; } foreach my $metric (keys %{$self->{metrics_mapping_transformed}}) { From e789b325e3f37477ef2bd410c3adf6f7ce20723d Mon Sep 17 00:00:00 2001 From: matoy Date: Mon, 17 May 2021 17:30:55 +0200 Subject: [PATCH 03/10] Update storage.pm --- cloud/azure/database/mysql/mode/storage.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/database/mysql/mode/storage.pm b/cloud/azure/database/mysql/mode/storage.pm index adf639d37..b919e41aa 100644 --- a/cloud/azure/database/mysql/mode/storage.pm +++ b/cloud/azure/database/mysql/mode/storage.pm @@ -146,7 +146,7 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - $metrics_mapping_transformed->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; + $metrics_mapping_transformed->{$metric_type} = $self->{resource_mapping}->{$metric_type}; } foreach my $metric (keys %{$self->{metrics_mapping_transformed}}) { From 8a1c6e9a67ccc2834b0349a8331cbffc2f3caa75 Mon Sep 17 00:00:00 2001 From: matoy Date: Mon, 17 May 2021 17:47:38 +0200 Subject: [PATCH 04/10] Update replication.pm --- cloud/azure/database/mysql/mode/replication.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/database/mysql/mode/replication.pm b/cloud/azure/database/mysql/mode/replication.pm index 7a56d4ad6..00c7328b9 100644 --- a/cloud/azure/database/mysql/mode/replication.pm +++ b/cloud/azure/database/mysql/mode/replication.pm @@ -109,7 +109,7 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - $metrics_mapping_transformed->{$metric_type} = $self->{resource_mapping}->{$metric_type}; + $self->{metrics_mapping_transformed}->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; } foreach my $metric (keys %{$self->{metrics_mapping_transformed}}) { From 12eb26f7c5875287d668ab904b792fe52bdf428a Mon Sep 17 00:00:00 2001 From: matoy Date: Mon, 17 May 2021 17:47:57 +0200 Subject: [PATCH 05/10] Update connections.pm --- cloud/azure/database/mysql/mode/connections.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/database/mysql/mode/connections.pm b/cloud/azure/database/mysql/mode/connections.pm index 66e341d5e..3e6d3cfe3 100644 --- a/cloud/azure/database/mysql/mode/connections.pm +++ b/cloud/azure/database/mysql/mode/connections.pm @@ -123,7 +123,7 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - $metrics_mapping_transformed->{$metric_type} = $self->{resource_mapping}->{$metric_type}; + $self->{metrics_mapping_transformed}->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; } foreach my $metric (keys %{$self->{metrics_mapping_transformed}}) { From b2159b0a9e5f269dd361aebadc5faf620dcfc3ed Mon Sep 17 00:00:00 2001 From: matoy Date: Mon, 17 May 2021 17:54:33 +0200 Subject: [PATCH 06/10] Update storage.pm --- cloud/azure/database/mysql/mode/storage.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/azure/database/mysql/mode/storage.pm b/cloud/azure/database/mysql/mode/storage.pm index b919e41aa..c8e323642 100644 --- a/cloud/azure/database/mysql/mode/storage.pm +++ b/cloud/azure/database/mysql/mode/storage.pm @@ -126,7 +126,7 @@ sub check_options { $self->{az_resource_type} = $resource_type; $self->{az_resource_namespace} = 'Microsoft.DBforMySQL'; $self->{az_timeframe} = defined($self->{option_results}->{timeframe}) ? $self->{option_results}->{timeframe} : 900; - $self->{az_interval} = defined($self->{option_results}->{interval}) ? $self->{option_results}->{interval} : 'PT5M'; + $self->{az_interval} = defined($self->{option_results}->{interval}) ? $self->{option_results}->{interval} : 'PT15M'; $self->{az_aggregations} = ['Maximum']; if (defined($self->{option_results}->{aggregation})) { $self->{az_aggregations} = []; @@ -146,7 +146,7 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - $metrics_mapping_transformed->{$metric_type} = $self->{resource_mapping}->{$metric_type}; + $self->{metrics_mapping_transformed}->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; } foreach my $metric (keys %{$self->{metrics_mapping_transformed}}) { From 9a16c86ba21ea3af8ba4f902fc3da707567a4b6c Mon Sep 17 00:00:00 2001 From: matoy Date: Wed, 19 May 2021 15:08:27 +0200 Subject: [PATCH 07/10] Update cloud/azure/database/mysql/mode/storage.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/database/mysql/mode/storage.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/azure/database/mysql/mode/storage.pm b/cloud/azure/database/mysql/mode/storage.pm index c8e323642..8596b89fc 100644 --- a/cloud/azure/database/mysql/mode/storage.pm +++ b/cloud/azure/database/mysql/mode/storage.pm @@ -146,10 +146,10 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - $self->{metrics_mapping_transformed}->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; + $metrics_mapping_transformed->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; } - foreach my $metric (keys %{$self->{metrics_mapping_transformed}}) { + foreach my $metric (keys %{$metrics_mapping_transformed}) { next if (defined($self->{option_results}->{filter_metric}) && $self->{option_results}->{filter_metric} ne '' && $metric !~ /$self->{option_results}->{filter_metric}/); push @{$self->{az_metrics}}, $metric; From a42bae69d4cd12b4d930939260fb38b399380ebe Mon Sep 17 00:00:00 2001 From: matoy Date: Wed, 19 May 2021 15:08:40 +0200 Subject: [PATCH 08/10] Update cloud/azure/database/mysql/mode/replication.pm Co-authored-by: itoussies <65223458+itoussies@users.noreply.github.com> --- cloud/azure/database/mysql/mode/replication.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/azure/database/mysql/mode/replication.pm b/cloud/azure/database/mysql/mode/replication.pm index 00c7328b9..99497d770 100644 --- a/cloud/azure/database/mysql/mode/replication.pm +++ b/cloud/azure/database/mysql/mode/replication.pm @@ -109,10 +109,10 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - $self->{metrics_mapping_transformed}->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; + ${metrics_mapping_transformed}->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; } - foreach my $metric (keys %{$self->{metrics_mapping_transformed}}) { + foreach my $metric (keys %{$metrics_mapping_transformed}) { next if (defined($self->{option_results}->{filter_metric}) && $self->{option_results}->{filter_metric} ne '' && $metric !~ /$self->{option_results}->{filter_metric}/); push @{$self->{az_metrics}}, $metric; From 760a967c7878bdb16fa8dedee4c499e90a803564 Mon Sep 17 00:00:00 2001 From: itoussies <65223458+itoussies@users.noreply.github.com> Date: Wed, 19 May 2021 15:58:25 +0200 Subject: [PATCH 09/10] Update connections.pm --- cloud/azure/database/mysql/mode/connections.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/azure/database/mysql/mode/connections.pm b/cloud/azure/database/mysql/mode/connections.pm index 3e6d3cfe3..ed7fed9a0 100644 --- a/cloud/azure/database/mysql/mode/connections.pm +++ b/cloud/azure/database/mysql/mode/connections.pm @@ -123,10 +123,10 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - $self->{metrics_mapping_transformed}->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; + $metrics_mapping_transformed->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; } - foreach my $metric (keys %{$self->{metrics_mapping_transformed}}) { + foreach my $metric (keys %{$metrics_mapping_transformed}) { next if (defined($self->{option_results}->{filter_metric}) && $self->{option_results}->{filter_metric} ne '' && $metric !~ /$self->{option_results}->{filter_metric}/); push @{$self->{az_metrics}}, $metric; From 5702f1f65362911e37af934d929ff225ce114d85 Mon Sep 17 00:00:00 2001 From: itoussies <65223458+itoussies@users.noreply.github.com> Date: Wed, 19 May 2021 16:00:56 +0200 Subject: [PATCH 10/10] Update replication.pm --- cloud/azure/database/mysql/mode/replication.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/database/mysql/mode/replication.pm b/cloud/azure/database/mysql/mode/replication.pm index 99497d770..24bade192 100644 --- a/cloud/azure/database/mysql/mode/replication.pm +++ b/cloud/azure/database/mysql/mode/replication.pm @@ -109,7 +109,7 @@ sub check_options { my $metrics_mapping_transformed; foreach my $metric_type (@{$resource_mapping->{$resource_type}}) { - ${metrics_mapping_transformed}->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; + $metrics_mapping_transformed->{$metric_type} = $self->{metrics_mapping}->{$metric_type}; } foreach my $metric (keys %{$metrics_mapping_transformed}) {