Open alexmojaki opened 1 month ago
Remove the django extra and replace it with django-wsgi and django-asgi.
We can also just add django-async
.
The first step here is to document this.
Remove the django extra and replace it with django-wsgi and django-asgi.
We can also just add
django-async
.
The idea is that the user has to be aware of the distinction and make an explicit choice. If they don't check docs carefully they may easily think that pip install logfire[django]
should just work, they won't get an error at any point.
A user couldn't get the Django instrumentation working (https://pydanticlogfire.slack.com/archives/C06EDRBSAH3/p1722460460137619?thread_ts=1722440635.372479&cid=C06EDRBSAH3). With difficulty we realised that it was because they were using ASGI. In
opentelemetry/instrumentation/django/middleware/otel_middleware.py
you can see that ASGI requests are silently ignored whenopentelemetry-instrumentation-asgi
isn't installed.Firstly, we should document this loudly.
Then for people who miss this point, we should either:
is_asgi
parameter toinstrument_django
to force the user to tell us the situation, then raise an error if needed.opentelemetry-instrumentation-asgi
with thedjango
extra.django
extra and replace it withdjango-wsgi
anddjango-asgi
.@samuelcolvin what do you think?