elastic / beats

:tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash
https://www.elastic.co/products/beats
Other
12.05k stars 4.89k forks source link

GCP labels are being omitted #40033

Open gpop63 opened 2 days ago

gpop63 commented 2 days ago

When parsing time series objects, we're omitting key labels like instance_id, zone, and project_id.

https://github.com/elastic/beats/blob/c2b2983c1825dcf7dabf64c4a04ce9cf34814fce/x-pack/metricbeat/module/gcp/timeseries_metadata_collector.go#L103

This omission seems to be because these are ECS fields. While this is acceptable if the service has metadata, such as compute, it results in missing crucial labels for services without additional metadata logic.

For instance, when fetching the instance/leader_percentage_by_region metric for the spanner service, the instance_id label is missing. This leads to a discrepancy between what we deliver and what users see in the GCP Metrics Explorer.

We need to ensure these ECS fields are included even if the service lacks metadata.

cc: @ishleenk17