cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

add `snapshot` flag to `cockroach debug` which only grabs stacks, cpu, and heap profs from nodes

Open msbutler opened this issue 2 years ago • 2 comments

Currently, there is no quick way to grab all stacks and profiles from all nodes via the cli. While, these all get collected via a normal cockroach debug run, the default collection could take at least 10x longer than it takes to manually grab just stacks and profiles. I propose adding a new "snaphot" flag which just grabs the stacks, cpu and heap profiles from all nodes. Hopefully the other debug flags play nice with this (e.g. --cpu-profile-duration). Feel free to bikeshed the name.

In a recent escalation, the DR team wanted to easily grab stacks/profiles across nodes multiple times to investigate a stuck job but could only do so every 20 minutes, the time it took to run a regular debug zip command.

Jira issue: CRDB-45085

msbutler avatar Dec 02 '24 14:12 msbutler

@msbutler we have extended include-files & exclude-files filters for all files generated as part of debug.zip. Here is the PR: https://github.com/cockroachdb/cockroach/pull/136098

In short, debug zip command will fetch the data for the files which are matching from include-files & exclude-files check. If the file is getting filtered out then we are skipping the fetching content of the file.

In your case, you could just provide the required regex to include the required files.

Let me know if it solves your usecase.

aa-joshi avatar Jan 23 '25 11:01 aa-joshi

@aa-joshi thank you so much! i'll give this a spin soon.

msbutler avatar Jan 23 '25 14:01 msbutler