-
Notifications
You must be signed in to change notification settings - Fork 624
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
Document how to use with Gunicorn and uWSGI #291
Document how to use with Gunicorn and uWSGI #291
Comments
//cc @lzchen |
Hi, do you have any examples of how this would work with the opentelemetry-python client? I.e. how signalfx then goes to open-telemetry |
Documenting this with an example is what this task is about so we'll have one once this issue is resolved. You can replace signalfx tracing with opentelemetry in the example project I shared and it should work. |
We should probably have similar thing for ASGI servers such as uvicorn, hypercorn etc.. |
I think @lonewolf3739 or @aabmass suggested to add a page to the examples section. I think that makes sense. It already has some similar content such as https://opentelemetry-python.readthedocs.io/en/stable/examples/django/README.html This doc lives in the core repo. We should move instrumentation exampes to contrib repo and add pages for gunicorn, uWSGI and any other frameworks that need special setup. Existing examples: https://github.com/open-telemetry/opentelemetry-python/tree/master/docs Some of these should be migrated to contrib. |
@owais, I remember we discussed this before, but how does this solution work with development servers (like |
Yes, unfortunately it need to be called in a separate place for manage.py. Good thing is that it is just regular python code so it can be just a function import and call from both places |
BTW this is documented over at Splunk's Otel distribution of Python here: https://github.com/signalfx/splunk-otel-python#special-cases Anyone wanting to take this one can refer to that as an example. |
Related issue open-telemetry/opentelemetry-python#1567 |
I will pick this up and probably complete by this weekend unless someone else either working on this or want to work this. |
Sorry for resurrecting, but a quick question - Is there any difference to having the app instrumentation happen in the I mean, instead of having two separate places that handle with OTEL code, like in the example we have -
and in the gunicorn config:
Where we could just have, in the gunicorn config:
|
@zionsofer Yes, you can certainly do that. |
Batch span processor does not work well with Gunicorn's forking model out of the box. Users need to leverage gunicorns worker hooks to setup tracing for each worker after the worker has started. This should be documented with examples.
An example django+gunicorn project that solves the same problem with signalfx-python-tracing:
https://github.com/owais/django-trace-test
https://github.com/owais/django-trace-test/blob/master/src/gunicorn.config.py
https://github.com/owais/django-trace-test/blob/master/docker-entrypoint.sh#L13
The text was updated successfully, but these errors were encountered: