elastic / elastic/apm-agent-python

Django Channels Websocket Trace

Ouverte
#2,123 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
agent-python community triage
Langage dominant
Python
Étoiles
431
Forks
239
Merge moyen
5 j 10 h
PR mergées (30 j)
7

Description

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez au point d’entrée ASGITracingMiddleware.__call__ présenté dans l’issue et reproduisez le comportement avec Django 4.2.11, Channels 4.0.0, Daphne 4.1.0 et elastic-apm 6.23.0. Déterminez d’abord si les scopes websocket sont censés produire des traces ; l’issue ne définit ni le comportement requis ni l’emplacement d’un test, la finalisation dépend donc d’un accord sur ce périmètre.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
django, python
Domaine
backend, observability-sre
Type d'issue
Bug
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.