-
Notifications
You must be signed in to change notification settings - Fork 706
Django gunicorn auto instrumentation #2038
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
Comments
It is not supported by the opentelemetry-instrument command. Docs mention it and explain how to instrument gunicorn based services: https://opentelemetry-python.readthedocs.io/en/latest/examples/fork-process-model/README.html?highlight=gunicorn#working-with-fork-process-models |
I'd like to leave this open in the hope of adding native support for gunicorn to the opentelemetry-instrument command. |
AFAIK, even the we need to add the following to initialize auto-instrumentation
|
I remember using Gunicorn with auto instrumentation and see it emit traces while debugging some issue. |
Any update on this making to the next version. |
Does open-telemetry support manual instrumentation for Gunicorn then? |
At the end there are some solutions for reference open-telemetry/opentelemetry-python-contrib#2086 |
I have found it very painful to even manually instrument a gunicorn+Django web server. Several chicken/egg
I was able to work around part of this flow issue if I wanted to use WSGI's
As a side-note, there is no discussion about the usage of the WSGI instrumentation vs Django instrumentation. Looking at their implementations, seems like we have to use one or the other, not both. To compare:
However, what we haven't been able to do yet is call DjangoInstrumentor.instrument during When So to re-initialize the middleware, I did something like the following:
Your mileage may vary, but that seemed to do the trick for me. I wish it was easier to auto-instrument without all these manual steps, but the mix of gunicorn, Django, and OpenTelemetry instrumentation approaches seem to not mix great for that without it. |
Currently, Django autoinstrumentation supports flask and uWSGI servers.
However, when running django app using gunicorn server, the autoinstrumentation does not work.
This is the command I am trying to run.
opentelemetry-instrument --trace-exporter zipkin_json python3.8 gunicorn ${DJANGO_WSGI_MODULE}:application --name ${NAME} --bind=127.0.0.1:80 --preload
The app starts fine, but doesn't report any traces to zipkin.
The text was updated successfully, but these errors were encountered: