-
Notifications
You must be signed in to change notification settings - Fork 647
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
Research if Django instrumentation can auto-detect DJANGO_SETTINGS_MODULE
when auto-instrumentation is used
#677
Comments
But how? 🤔 I may be missing something but if Django itself needs this to be defined directly by the user in an environment variable (because it can't figure it out by itself), I don't see how our instrumentation can do it. |
I don't know how :) Part of the issue is to research and figure out the answer and the answer may very well be that is is not possible to do. |
DJANGO_SETTINGS_MODULE
when auto-instrumentation is usedDJANGO_SETTINGS_MODULE
when auto-instrumentation is used
Ah, ok. I was a bit confused 😆 I have edited this issue to reflect the actual intention. 👍 |
I see this issue is old but still open. I used to have this issue, but it seems to have stopped. Was there an intentional fix? |
Testing this out, here's what I found:
Since this would cause issues for non-django apps, and it is unreasonable to ask that users always uninstall django on their machines when running non-django apps or to have a
|
Currently users are required to set the
DJANGO_SETTINGS_MODULE
env var when auto-instrumenting Django. It would be convenient for the auto-instrumentation to be able to figure this out automatically.hint: it might be possible to fix this by lazily import
django.conf.settings
instead of here: https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py#L80Currenly the instrumentation fails if the env var is not setup:
The text was updated successfully, but these errors were encountered: