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

Add support for region/zone for Vertex AI service in GCP module #41551

Merged
merged 2 commits into from
Nov 8, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Restore docker.network.in.* and docker.network.out.* fields in docker module {pull}40968[40968]
- Add `id` field to all the vSphere metricsets. {pull}41097[41097]
- 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*

Expand Down
16 changes: 9 additions & 7 deletions x-pack/metricbeat/module/gcp/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -82,13 +83,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
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/gcp/metrics/metrics_requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 {
Expand Down
Loading