Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Feature Idea: New Relic with Django Channels (Daphne/ASGI)

feature-idea
developer

#22

Any suggestions on how to make this work with gunicorn + uvicorn worker? After following your instructions I get this exception -

Traceback (most recent call last):
  File "/.local/share/virtualenvs/x5YVXj3s/lib/python3.7/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File "/.local/share/virtualenvs/x5YVXj3s/lib/python3.7/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
    return await self.app(scope, receive, send)
  File "/.local/share/virtualenvs/x5YVXj3s/lib/python3.7/site-packages/uvicorn/middleware/asgi2.py", line 6, in __call__
    instance = self.app(scope)
  File "/.local/share/virtualenvs/x5YVXj3s/lib/python3.7/site-packages/newrelic/api/wsgi_application.py", line 564, in _nr_wsgi_application_wrapper_
    environ, start_response = _args(*args, **kwargs)
TypeError: _args() missing 1 required positional argument: 'start_response'```

#23

@jamie28 New Relic assumes gunicorn is being used to run a WSGI app and tries to instrument it as such.

You can disable this in your newrelic.ini by adding this:

[import-hook:gunicorn.app.base]
enabled = false

This got the solution from @andrey20 working for me with gunicorn and uvicorn workers.