Skip to content

Add option to sample scrape targets using Alloy #3906

@bryanhuhta

Description

@bryanhuhta

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions