Skip to content

Commit

Permalink
Region and zone ecs fields nested in cloud field (#37015)
Browse files Browse the repository at this point in the history
  • Loading branch information
ishleenk17 authored Nov 3, 2023
1 parent 9ad141b commit 48e0660
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ is collected by it.
- Add log error when statsd server fails to start {pull}36477[36477]
- Fix CassandraConnectionClosures metric configuration {pull}34742[34742]
- Fix event mapping implementation for statsd module {pull}36925[36925]
- The region and availability_zone ecs fields nested within the cloud field. {pull}37015[37015]

*Osquerybeat*

Expand Down
6 changes: 3 additions & 3 deletions x-pack/metricbeat/module/gcp/compute/_meta/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"id": "1113015278728017638",
"name": "gke-apm-ci-k8s-cluster-pool-2-e8852348-58mx"
},
"provider": "gcp"
"provider": "gcp",
"availability_zone": "us-central1-a",
"region": "us-central1"
},
"cloud.availability_zone": "us-central1-c",
"cloud.region": "us-central1",
"event": {
"dataset": "gcp.compute",
"duration": 115000,
Expand Down
6 changes: 3 additions & 3 deletions x-pack/metricbeat/module/gcp/compute/_meta/data_cpu.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"id": "7206859884978665190",
"name": "gke-apm-ci-k8s-cluster-pool-2-e8852348-rt8n"
},
"provider": "gcp"
"provider": "gcp",
"availability_zone": "us-central1-a",
"region": "us-central1"
},
"cloud.availability_zone": "us-central1-c",
"cloud.region": "us-central1",
"event": {
"dataset": "gcp.compute",
"duration": 115000,
Expand Down
6 changes: 3 additions & 3 deletions x-pack/metricbeat/module/gcp/compute/_meta/data_disk.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"id": "4281532529829668842",
"name": "synthetics-service"
},
"provider": "gcp"
"provider": "gcp",
"availability_zone": "us-central1-a",
"region": "us-central1"
},
"cloud.availability_zone": "us-central1-a",
"cloud.region": "us-central1",
"event": {
"dataset": "gcp.compute",
"duration": 115000,
Expand Down
6 changes: 3 additions & 3 deletions x-pack/metricbeat/module/gcp/compute/_meta/data_firewall.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"id": "8825965883407652424",
"name": "heartbeat-los-angeles"
},
"provider": "gcp"
"provider": "gcp",
"availability_zone": "us-west2-a",
"region": "us-west2-a"
},
"cloud.availability_zone": "us-west2-a",
"cloud.region": "us-west2",
"event": {
"dataset": "gcp.compute",
"duration": 115000,
Expand Down
6 changes: 3 additions & 3 deletions x-pack/metricbeat/module/gcp/compute/_meta/data_memory.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"machine": {
"type": "e2-micro"
},
"provider": "gcp"
"provider": "gcp",
"availability_zone": "us-central1-a",
"region": "us-central1"
},
"cloud.availability_zone": "us-central1-a",
"cloud.region": "us-central1",
"event": {
"dataset": "gcp.compute",
"duration": 115000,
Expand Down
6 changes: 3 additions & 3 deletions x-pack/metricbeat/module/gcp/compute/_meta/data_network.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"id": "1113015278728017638",
"name": "gke-apm-ci-k8s-cluster-pool-2-e8852348-58mx"
},
"provider": "gcp"
"provider": "gcp",
"availability_zone": "us-central1-a",
"region": "us-central1"
},
"cloud.availability_zone": "us-central1-c",
"cloud.region": "us-central1",
"event": {
"dataset": "gcp.compute",
"duration": 115000,
Expand Down
4 changes: 2 additions & 2 deletions x-pack/metricbeat/module/gcp/timeseries_metadata_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ func (s *StackdriverTimeSeriesMetadataCollector) Metadata(ctx context.Context, i
}

if availabilityZone != "" {
ecs[ECSCloud+"."+ECSCloudAvailabilityZone] = availabilityZone
_, _ = ecs.Put(ECSCloud+"."+ECSCloudAvailabilityZone, availabilityZone)

// Get region name from availability zone name
region := getRegionName(availabilityZone)
if region != "" {
ecs[ECSCloud+"."+ECSCloudRegion] = region
_, _ = ecs.Put(ECSCloud+"."+ECSCloudRegion, region)
}
}

Expand Down

0 comments on commit 48e0660

Please sign in to comment.