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

[GCP] Optimize metrics metricset and metadata collection #40582

Open
gpop63 opened this issue Aug 22, 2024 · 2 comments
Open

[GCP] Optimize metrics metricset and metadata collection #40582

gpop63 opened this issue Aug 22, 2024 · 2 comments
Labels
Team:obs-ds-hosted-services Label for the Observability Hosted Services team Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team

Comments

@gpop63
Copy link
Contributor

gpop63 commented Aug 22, 2024

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:

  • No caching mechanism
  • Metadata collected every period (usually 1 minute)
  • All fields from GCP responses are collected, potentially including unused data

Google's official recommendations for optimizing API calls (https://cloud.google.com/resource-manager/docs/performance) suggest:

Test Results (instances.aggregatedList)

api_response_time_and_size_comparison

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 and ListMetricDescriptors calls, possibly by enabling gzip compression.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Aug 22, 2024
@gpop63 gpop63 added the Team:obs-ds-hosted-services Label for the Observability Hosted Services team label Aug 22, 2024
@elasticmachine
Copy link
Collaborator

Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Aug 22, 2024
@gpop63 gpop63 added needs_team Indicates that the issue/PR needs a Team:* label Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team labels Aug 22, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Aug 22, 2024
@botelastic
Copy link

botelastic bot commented Aug 22, 2024

This issue doesn't have a Team:<team> label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:obs-ds-hosted-services Label for the Observability Hosted Services team Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team
Projects
None yet
Development

No branches or pull requests

2 participants