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

Gunicorn mutliprocess with app factory pattern examples #154

Open
jdyer09 opened this issue Mar 18, 2023 · 1 comment
Open

Gunicorn mutliprocess with app factory pattern examples #154

jdyer09 opened this issue Mar 18, 2023 · 1 comment

Comments

@jdyer09
Copy link

jdyer09 commented Mar 18, 2023

I'm wondering if it's possible to use the app factory pattern with the gunicorn multiprocess version of the exporter? My knowledge around the internals of the factory pattern are admittedly a little lacking and I'm not quite sure how to make this work.

I'm happy to try and put together a code sample for the examples folder if someone can provide me with a step in the right direction.

I'm also starting to think that this just isn't a use case that exists, am I right in thinking that since the multiprocess version spins up it's own flask application that it it doesn't need the factory pattern at all? Also, following this, the readme for the multiprocess gunicorn example references a config.py that isn't there, I assume the config isn't needed in the example, and it's a copy paste error in the README? https://github.com/rycus86/prometheus_flask_exporter/blob/master/examples/gunicorn-multiprocess-109/README.md

@rycus86
Copy link
Owner

rycus86 commented Mar 19, 2023

Hello!

I'm wondering if it's possible to use the app factory pattern with the gunicorn multiprocess version of the exporter?

Yeah, I don't see why not, though admittedly I haven't tried. If you give it a go and run into problems, let me know and we can work it out together.

Also, following this, the readme for the multiprocess gunicorn example references a config.py that isn't there, I assume the config isn't needed in the example, and it's a copy paste error in the README?

Yep, I think you're right, I must have copied the README from another example that actually has & needs a config.py.

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

No branches or pull requests

2 participants