diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 6b7a679fd93..c764e5409eb 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -368,6 +368,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] - Add `id` field to all the vSphere metricsets. {pull}41097[41097] - Bump aerospike-client-go to version v7.7.1 and add support for basic auth in Aerospike module {pull}41233[41233] - Only watch metadata for ReplicaSets in metricbeat k8s module {pull}41289[41289] +- Add support for region/zone for Vertex AI service in GCP module {pull}41551[41551] *Metricbeat* diff --git a/x-pack/metricbeat/module/gcp/constants.go b/x-pack/metricbeat/module/gcp/constants.go index 787cb63f56a..aeab72a7a07 100644 --- a/x-pack/metricbeat/module/gcp/constants.go +++ b/x-pack/metricbeat/module/gcp/constants.go @@ -27,6 +27,7 @@ const ( ServiceDataproc = "dataproc" ServiceCloudSQL = "cloudsql" ServiceRedis = "redis" + ServiceAIPlatform = "aiplatform" ) // Paths within the GCP monitoring.TimeSeries response, if converted to JSON, where you can find each ECS field required for the output event @@ -81,13 +82,14 @@ const ( // NOTE: if you are adding labels make sure to update tests in metrics/metrics_requester_test.go. const ( - DefaultResourceLabel = "resource.label.zone" - ComputeResourceLabel = "resource.labels.zone" - GKEResourceLabel = "resource.label.location" - StorageResourceLabel = "resource.label.location" - CloudSQLResourceLabel = "resource.labels.region" - DataprocResourceLabel = "resource.label.region" - RedisResourceLabel = "resource.label.region" + DefaultResourceLabel = "resource.label.zone" + ComputeResourceLabel = "resource.labels.zone" + GKEResourceLabel = "resource.label.location" + StorageResourceLabel = "resource.label.location" + CloudSQLResourceLabel = "resource.labels.region" + DataprocResourceLabel = "resource.label.region" + RedisResourceLabel = "resource.label.region" + AIPlatformResourceLabel = "resource.label.location" ) // AlignersMapToGCP map contains available perSeriesAligner diff --git a/x-pack/metricbeat/module/gcp/metrics/metrics_requester.go b/x-pack/metricbeat/module/gcp/metrics/metrics_requester.go index d33d710f77a..ad0632e6c85 100644 --- a/x-pack/metricbeat/module/gcp/metrics/metrics_requester.go +++ b/x-pack/metricbeat/module/gcp/metrics/metrics_requester.go @@ -196,6 +196,8 @@ func getServiceLabelFor(serviceName string) string { return gcp.CloudSQLResourceLabel case gcp.ServiceRedis: return gcp.RedisResourceLabel + case gcp.ServiceAIPlatform: + return gcp.AIPlatformResourceLabel default: return gcp.DefaultResourceLabel } diff --git a/x-pack/metricbeat/module/gcp/metrics/metrics_requester_test.go b/x-pack/metricbeat/module/gcp/metrics/metrics_requester_test.go index 658568b66ca..9fb044e39e5 100644 --- a/x-pack/metricbeat/module/gcp/metrics/metrics_requester_test.go +++ b/x-pack/metricbeat/module/gcp/metrics/metrics_requester_test.go @@ -222,6 +222,7 @@ func TestIsAGlobalService(t *testing.T) { {"Dataproc service", gcp.ServiceDataproc, false}, {"CloudSQL service", gcp.ServiceCloudSQL, false}, {"Redis service", gcp.ServiceRedis, false}, + {"AIPlatform service", gcp.ServiceAIPlatform, false}, } for _, c := range cases { t.Run(c.title, func(t *testing.T) { @@ -249,6 +250,7 @@ func TestGetServiceLabelFor(t *testing.T) { {"Dataproc service", gcp.ServiceDataproc, "resource.label.region"}, {"CloudSQL service", gcp.ServiceCloudSQL, "resource.labels.region"}, {"Redis service", gcp.ServiceRedis, "resource.label.region"}, + {"AIPlatform service", gcp.ServiceAIPlatform, "resource.label.location"}, } for _, c := range cases {