From c320047207540bc0110f90a71bada7dd745527ff Mon Sep 17 00:00:00 2001 From: Linu Elias Date: Wed, 26 Jun 2024 17:04:33 +0530 Subject: [PATCH 1/3] fix-gcp-period --- CHANGELOG.next.asciidoc | 2 ++ x-pack/metricbeat/module/gcp/metrics/metricset.go | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 69d6a1763047..ee9aad2fd72c 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -167,6 +167,8 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] - Normalize AWS RDS CPU Utilization values before making the metadata API call. {pull}39664[39664] - Fix behavior of pagetypeinfo metrics {pull}39985[39985] - Fix query logic for temp and non-temp tablespaces in Oracle module. {issue}38051[38051] {pull}39787[39787] +- Fix for GCP to update the period value to default value(60s) when user specifies a value below the minimum period value in GCP. + *Osquerybeat* diff --git a/x-pack/metricbeat/module/gcp/metrics/metricset.go b/x-pack/metricbeat/module/gcp/metrics/metricset.go index 49cdce5d73a8..5505bedc04c6 100644 --- a/x-pack/metricbeat/module/gcp/metrics/metricset.go +++ b/x-pack/metricbeat/module/gcp/metrics/metricset.go @@ -144,7 +144,10 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { } if err := validatePeriodForGCP(m.Module().Config().Period); err != nil { - return nil, err + m.Logger().Warnf("Period has been updated to GCP default value as %s", err) + m.config.period = &durationpb.Duration{ + Seconds: int64(gcp.MonitoringMetricsSamplingRate), + } } // Get ingest delay and sample period for each metric type From 772a3978199f1a5469f5a99889a03791aabc718e Mon Sep 17 00:00:00 2001 From: Linu Elias Date: Wed, 26 Jun 2024 18:35:07 +0530 Subject: [PATCH 2/3] CHANGELOG.next.asciidoc --- CHANGELOG.next.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index ee9aad2fd72c..739482f69038 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -167,7 +167,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] - Normalize AWS RDS CPU Utilization values before making the metadata API call. {pull}39664[39664] - Fix behavior of pagetypeinfo metrics {pull}39985[39985] - Fix query logic for temp and non-temp tablespaces in Oracle module. {issue}38051[38051] {pull}39787[39787] -- Fix for GCP to update the period value to default value(60s) when user specifies a value below the minimum period value in GCP. +- Fix for GCP to update the period value to default value(60s) when user specifies a value below the minimum period value in GCP. {issue}30434[30434] {pull}40020[40020] *Osquerybeat* From ebef9080412ae4513c5a1794d74c8f4bcc962adf Mon Sep 17 00:00:00 2001 From: Linu Elias Date: Wed, 26 Jun 2024 18:38:36 +0530 Subject: [PATCH 3/3] resolved comments --- CHANGELOG.next.asciidoc | 2 +- x-pack/metricbeat/module/gcp/metrics/metricset.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 739482f69038..eed36bbd4f7f 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -167,7 +167,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] - Normalize AWS RDS CPU Utilization values before making the metadata API call. {pull}39664[39664] - Fix behavior of pagetypeinfo metrics {pull}39985[39985] - Fix query logic for temp and non-temp tablespaces in Oracle module. {issue}38051[38051] {pull}39787[39787] -- Fix for GCP to update the period value to default value(60s) when user specifies a value below the minimum period value in GCP. {issue}30434[30434] {pull}40020[40020] +- Set GCP metrics config period to the default (60s) when the value is below the minimum allowed period. {issue}30434[30434] {pull}40020[40020] *Osquerybeat* diff --git a/x-pack/metricbeat/module/gcp/metrics/metricset.go b/x-pack/metricbeat/module/gcp/metrics/metricset.go index 5505bedc04c6..0ac5f6d76a85 100644 --- a/x-pack/metricbeat/module/gcp/metrics/metricset.go +++ b/x-pack/metricbeat/module/gcp/metrics/metricset.go @@ -144,7 +144,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { } if err := validatePeriodForGCP(m.Module().Config().Period); err != nil { - m.Logger().Warnf("Period has been updated to GCP default value as %s", err) + m.Logger().Warnf("Period has been set to default value of 60s: %s", err) m.config.period = &durationpb.Duration{ Seconds: int64(gcp.MonitoringMetricsSamplingRate), }