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

Add a configuration option to pyroscope.scrape to define for how long a CPU profile should run #195

Closed
julienvey opened this issue Apr 3, 2024 · 2 comments · Fixed by #591

Comments

@julienvey
Copy link

Request

Right now, the only configuration option to customize scraping interval for CPU collection are scrape_interval and delta. If we want to use delta profiling, but reduce the amount of profiles we collect, there's no other options.

As the doc says

The seconds used will be equal to scrape_interval - 1. For example, if scrape_interval is "15s", seconds will be 14 seconds. If the HTTP endpoint is /debug/pprof/profile, then the HTTP query will become /debug/pprof/profile?seconds=14

  • If we set a larger scrape interval (60s), seconds will be 59
  • If we set a smaller scrape interval (15s), seconds will be 14

With this param, we are basically running profiles all the time (except for this 1s between profiles)

We could add a configuration option to let the user decide of this seconds value.

for instance

scrape_interval = 15s
scrape_duration = 5s

would result in a call to /debug/pprof/profile?seconds=5 every 15s. This would enable considerable savings on resources used by grafana-agent and pyroscope, if it's a tradeoff the user is willing to accept

Use case

User might want to reduce the amount of CPU profiles collected in order to save on resources (CPU, network, storage...)

@hainenber
Copy link
Contributor

@julienvey I've repeated the PR from the original one in grafana/agent. Finger crossed it'll get review and released! 🤞

Copy link
Contributor

This issue has not had any activity in the past 30 days, so the needs-attention label has been added to it.
If the opened issue is a bug, check to see if a newer release fixed your issue. If it is no longer relevant, please feel free to close this issue.
The needs-attention label signals to maintainers that something has fallen through the cracks. No action is needed by you; your issue will be kept open and you do not have to respond to this comment. The label will be removed the next time this job runs if there is new activity.
Thank you for your contributions!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.