Add WSGI helper methods#78
Merged
brian-brazil merged 1 commit intoprometheus:masterprometheus/client_python:masterfrom Apr 26, 2016
Merged
Add WSGI helper methods#78brian-brazil merged 1 commit intoprometheus:masterprometheus/client_python:masterfrom
brian-brazil merged 1 commit intoprometheus:masterprometheus/client_python:masterfrom
Conversation
prometheus_client/exposition.py
Outdated
Contributor
There was a problem hiding this comment.
Why the str?
We're using single quotes in this file.
Contributor
Author
There was a problem hiding this comment.
Why the str?
Because of the future import for unicode_literals, WSGI needs a str object. It does not make any difference for the BasicHTTPServer.
We're using single quotes in this file.
Done
b2e4c33 to
ab436cc
Compare
prometheus_client/exposition.py
Outdated
Contributor
There was a problem hiding this comment.
This sorts after contextlib
Contributor
|
Could you add a short example to the README? |
af15138 to
b532313
Compare
Contributor
Author
|
Added an example to the README |
README.md
Outdated
Contributor
There was a problem hiding this comment.
You're not using this
Add helper methods to make it easy to start a prometheus server as WSGI app. This makes it easier to integrate with other WSGI applications like flask or to start exposing metrics in your WSGI server of choice.
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi,
I tried to integrate the library with flask. It's easy but I had to go through the source code to find out what to do.
With this helper classes I hope to make it even easier for others. Someone can then just create a flask WSGI app and a Prometheus WSGI app and can do the routing in a third app.
Maybe another helper method for that might be nice too?