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

command/server: add support to write pprof files to the filesystem via SIGUSR2 #20609

Merged
merged 6 commits into from
May 17, 2023

Conversation

jasonodonnell
Copy link
Contributor

This adds support to dump pprof outputs to the filesystem when VAULT_PPROF_WRITE_TO_FILE and optionally VAULT_PPROF_FILE_PATH set on the Vault process. This is very useful in situations where HTTP handlers are unresponsive and we cannot use the sys/pprof endpoints. I put this behind an environment variable because files are generated each time there's a SIGUSR2 signal to avoid unintentionally generating a lot of files.

@jasonodonnell jasonodonnell added this to the 1.14 milestone May 16, 2023
@jasonodonnell jasonodonnell requested a review from a team May 16, 2023 20:07
@jasonodonnell jasonodonnell changed the title core/server: add support to write pprof files to the filesystem via SIGUSR2 command/server: add support to write pprof files to the filesystem via SIGUSR2 May 16, 2023
command/server.go Outdated Show resolved Hide resolved
command/server.go Show resolved Hide resolved
@jasonodonnell jasonodonnell merged commit 00855a9 into main May 17, 2023
87 checks passed
@jasonodonnell jasonodonnell deleted the pprof-signal-usr2 branch May 17, 2023 13:21
jasonodonnell added a commit that referenced this pull request May 17, 2023
…a SIGUSR2 (#20609)

* core/server: add support to write pprof files to the filesystem via SIGUSR2

* changelog

* Fix filepath join

* Use core logger

* Simplify logic

* Break on error
jasonodonnell added a commit that referenced this pull request May 17, 2023
…a SIGUSR2 (#20609)

* core/server: add support to write pprof files to the filesystem via SIGUSR2

* changelog

* Fix filepath join

* Use core logger

* Simplify logic

* Break on error
jasonodonnell added a commit that referenced this pull request May 17, 2023
…a SIGUSR2 (#20609) (#20621)

* core/server: add support to write pprof files to the filesystem via SIGUSR2

* changelog

* Fix filepath join

* Use core logger

* Simplify logic

* Break on error

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
jasonodonnell added a commit that referenced this pull request May 17, 2023
…a SIGUSR2 (#20609) (#20620)

* core/server: add support to write pprof files to the filesystem via SIGUSR2

* changelog

* Fix filepath join

* Use core logger

* Simplify logic

* Break on error

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants