-
Notifications
You must be signed in to change notification settings - Fork 714
Description
Is your feature request related to a problem? Please describe.
There's no mechanism to dynamically sample Kubernetes targets. We provide some guidance on how to sample workloads in this documentation: https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/sampling/. However, this assumes the workload is stable and the scaling doesn't change often, since the modulus value has to be hardcoded.
For workloads that can autoscale, this approach results in an increase of ingested profiles linearly proportional to the autoscale amount. That means a 10x autoscale corresponds to a 10x increase in profiles ingested. This linear increase isn't always desirable.
Describe the solution you'd like
One solution is to provide a setting on the pyroscope.scrape and pyroscope.ebpf to limit the number of targets it forwards. This could be a percentage (e.g. 10%) or a flat rate (e.g. 50).