googleapis / googleapis/google-cloud-go

cloudprofiler: Configurable sample rate

Open
#10,050 0 comments 0 reactions 1 assignee Claimed by @mr-arc View on GitHub
api: cloudprofiler samples triage me
Dominant language
Go
Stars
4.5k
Forks
1.6k
Avg merge
1d 13h
Merged PRs (30d)
109

Description

**Is your feature request related to a problem? Please describe.**
There is no mechanism to configure (reduce) the sample rate of the [profiler](https://pkg.go.dev/cloud.google.com/go/profiler) package, and thus reduce the number of update requests per minute to the Cloud Profiler API. The default GCP quota for Cloud Profiler API update requests is 100 per minute, and the profiler makes [1 update request per profile type per minute](https://cloud.google.com/profiler/quotas#quotas_and_limits). So, 20-25 services in a single GCP project will hit this quota easily with default profile types (faster if you enable mutexes).

**Describe the solution you'd like**
The [profiler.Config](https://pkg.go.dev/cloud.google.com/go/profiler#Config) type has a positive integer `SampleRate` field that allows you to specify the number of minutes between samples (default, minimum 1).

**Describe alternatives you've considered**
Increasing GCP quota for the API

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.