[GCP] Optimize metrics
metricset and metadata collection
#40582
Labels
Team:obs-ds-hosted-services
Label for the Observability Hosted Services team
Team:Obs-InfraObs
Label for the Observability Infrastructure Monitoring team
Overview
We've observed performance issues with the GCP
metrics
metricset when collecting data from a large number of projects with many instances. This affects services with or without additional metadata collection.Current behavior:
Google's official recommendations for optimizing API calls (https://cloud.google.com/resource-manager/docs/performance) suggest:
Test Results (
instances.aggregatedList
)Tested on my machine, so results may vary on other systems.
Using custom fields significantly reduced response size (from ~24 MB to 0.146 MB) and improved performance (from 4.05s to 2.10s). The impact of gzip is not so noticeable in this test maybe because it's small scale, but it could be more significant with larger datasets or over slower network connections.
Custom fields used in test:
id,items/zones/instances(name,labels,machineType,status)
But as I mentioned earlier, services without extra metadata API calls can have issues. We should optimize the
ListTimeSeries
andListMetricDescriptors
calls, possibly by enabling gzip compression.The text was updated successfully, but these errors were encountered: