Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add WSGI helper methods#78

Merged
brian-brazil merged 1 commit intoprometheus:masterprometheus/client_python:masterfrom
rmohr:masterrmohr/client_python:masterCopy head branch name to clipboard
Apr 26, 2016
Merged

Add WSGI helper methods#78
brian-brazil merged 1 commit intoprometheus:masterprometheus/client_python:masterfrom
rmohr:masterrmohr/client_python:masterCopy head branch name to clipboard

Conversation

@rmohr
Copy link
Contributor

@rmohr rmohr commented Apr 26, 2016

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the str?

We're using single quotes in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@rmohr rmohr force-pushed the master branch 2 times, most recently from b2e4c33 to ab436cc Compare April 26, 2016 13:41
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sorts after contextlib

@brian-brazil
Copy link
Contributor

Could you add a short example to the README?

@rmohr rmohr force-pushed the master branch 2 times, most recently from af15138 to b532313 Compare April 26, 2016 14:09
@rmohr
Copy link
Contributor Author

rmohr commented Apr 26, 2016

Added an example to the README

README.md Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're not using this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

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.
@brian-brazil brian-brazil merged commit 9a188ac into prometheus:master Apr 26, 2016
@brian-brazil
Copy link
Contributor

Thanks!

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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.