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

Bullettrace in profiler. #614

Closed
HelloGrayson opened this issue Oct 22, 2014 · 3 comments
Closed

Bullettrace in profiler. #614

HelloGrayson opened this issue Oct 22, 2014 · 3 comments

Comments

@HelloGrayson
Copy link

Wondering about the possibility of allowing profiler to be temporarily turned on by headers configured when instantiating the middleware. This would allow people to capture profiles in production.

Some ideas:

# enable profile for this request
curl myapp.com -H X-Werkzeug-Profiling-Enabled:1

# enable profile, emailing to me@myspace.com
curl myapp.com -H X-Werkzeug-Profiling-Enabled -H X-Werkzeug-Profiling-Email-To:me@myspace.com 

# profile and write to my home dir
curl myapp.com -H  X-Werkzeug-Profiling-Enabled:1 -H X-Werkzeug-Profiling-Write-To:/home/me/profs

Thoughts?

@untitaker
Copy link
Contributor

I'd implement these header features in a subclass of the original profiler middleware. However, much of contrib (including the profiler itself) is already out-of-scope for Werkzeug, see #4. Maybe it still could stay in Werkzeug (because it's a useful WSGI middleware), i don't know.

@HelloGrayson
Copy link
Author

I see. Potentially I could just create a standalone python package containing a WSGI middleware. Doesn't look like I need anything specific to Werkzeug even. Thanks @untitaker

@untitaker
Copy link
Contributor

The whole contrib stuff could be packaged separately, there is AFAIK nothing that couples them. If you are interested, you could build your own standalone WSGI profiler forked from Werkzeug and for version 1.0 we'll deprecate Werkzeug's in favour of yours.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants