Skip to content
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

Django Channels Websocket Trace #2123

Open
abhinavsingh opened this issue Sep 10, 2024 · 1 comment
Open

Django Channels Websocket Trace #2123

abhinavsingh opened this issue Sep 10, 2024 · 1 comment
Labels
agent-python community Issues opened by the community triage Issues awaiting triage

Comments

@abhinavsingh
Copy link

Describe the bug:

I was expecting APM to help me understand whats going within my websocket connections (Django + Channels + Daphne). However, the very first line of ASGITracingMiddleware ignores non-http scopes:

async def __call__(self, scope: "Scope", receive: "ASGIReceiveCallable", send: "ASGISendCallable") -> None:
        if scope["type"] != "http":
            await self._app(scope, receive, send)
            return

To Reproduce

  1. Install elastic-apm
  2. Configure ELASTIC_APM settings
  3. Configure ASGITracingMiddleware middleware
  4. Kibana shows the service name but no traces

Environment (please complete the following information)

  • OS: [e.g. Linux]
  • Python version: 3.11
  • Framework and version [e.g. Django 2.1]:
Django==4.2.11
channels==4.0.0
channels-redis==4.1.0
daphne==4.1.0
  • APM Server version:
  • Agent version:
elastic-apm==6.23.0
elastic-transport==8.15.0
elasticsearch==8.15.0

Is this expected or a bug?

Thank you
Abhinav

@github-actions github-actions bot added agent-python community Issues opened by the community triage Issues awaiting triage labels Sep 10, 2024
@xrmx
Copy link
Member

xrmx commented Sep 10, 2024

Thanks for reporting, given that there is a specific guard for skipping it I would say it's expected. Agree that adding support for tracing websocket may be helpful though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-python community Issues opened by the community triage Issues awaiting triage
Projects
None yet
Development

No branches or pull requests

2 participants