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

Capture CPU profiles in audit #1298

Open
jarretlavallee opened this issue Mar 13, 2025 · 4 comments
Open

Capture CPU profiles in audit #1298

jarretlavallee opened this issue Mar 13, 2025 · 4 comments
Assignees
Labels
proposal Enhancement idea or proposal

Comments

@jarretlavallee
Copy link

Proposed change

Please add CPU profile collection to audit when passing --server-profiles.

Use case

CPU profile collection is often useful for diagnostics and would be worthwhile to collect when collecting the other profiles. CPU profile collection is available through profilez in 2.10.19+ and has been implemented in nats server request profile cpu.

Contribution

No response

@jarretlavallee jarretlavallee added the proposal Enhancement idea or proposal label Mar 13, 2025
@ripienaar
Copy link
Collaborator

CPU profiles is the odd one out that takes a while to gather so we need to do something extra there over what the gather command handles today.

We should also add the other profiles that we have now that audit isnt gathering

if c.profileName == "cpu" {
// people can use --timeout to adjust the wait time
opts.Duration = options.DefaultOptions.Timeout
// but we have to then bump timeout to give the network time
options.DefaultOptions.Timeout = options.DefaultOptions.Timeout + 2*time.Second
}

@jarretlavallee
Copy link
Author

Good point. Would it be possible to have it opt in or some other mechanism to include other files in the audit where we could have them run a CPU profile in advance and save it to that directory?

@ripienaar
Copy link
Collaborator

gather is already slow, I think its ok to make it a bit slower :) I think its useful by default to have this so we should just always grab it. Worse is forgetting and then needing it on a hard to reproduce issue

@jarretlavallee
Copy link
Author

Sounds good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Enhancement idea or proposal
Projects
None yet
Development

No branches or pull requests

3 participants