Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This single file is only included in the build if the "debug" build flag is specified so by default the /debug/pprof endpoints are excluded from the build.
When included, this not only attaches the /debug/pprof endpoints, but this also provides a new middleware we can apply to endpoints in the app so that any calls to that endpoint will result in a cpu profile (and optional memory profile) being generated in your /tmp folder.
These tools are for the devs and should not make it into a production release. Although the performance impact of such an endpoint being released would be negligible, the security implications of somebody accessing the memory of a running service are too great to just add auth to the endpoint. This and it's accompanying Cypress test are designed to ensure there will not be any debug or pprof code in the binary coming out of CI/CD.