elastic / elastic/apm-agent-python

Django Channels Websocket Trace

Aperta
#2,123 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
agent-python community triage
Lingua principale
Python
Stelle
431
Fork
239
Merge medio
5g 10h
PR unite (30g)
7

Descrizione

**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:

```python
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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.