aws / aws/aws-xray-sdk-python

subsegment not sending the Exception & SQL Trace

Aperta
#211 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
stale
Lingua principale
Python
Stelle
338
Fork
147
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Im trying to capture all my exception and SQL in AWS-XRAY . I have tried multiple approach and not able to find a proper solution.
my setting.py file
```
XRAY_RECORDER = {
'AWS_XRAY_DAEMON_ADDRESS': '127.0.0.1:2000',
'AWS_XRAY_TRACING_NAME': 'payment',
# 'PLUGINS': ('EC2Plugin'),
'AWS_XRAY_CONTEXT_MISSING': 'LOG_ERROR',
'AUTO_INSTRUMENT': True,
'SAMPLING': True,
# 'AWS_XRAY_SDK_ENABLED': True,
'STREAM_SQL':True
}
```
The error occurs in a function and goes to except block of code as below
```
except IntegrityError as e:
exception_logger(e,request)
return JsonResponse({"success": False, "code": 400, "error": str(e)}, status=400)
```
now in my expection__logger function ( Code as below )
```
with xray_recorder.in_segment('payment') as segment:
stack = traceback.extract_stack(limit=xray_recorder._max_trace_back)
segment.add_exception(e,stack)
with xray_recorder.in_subsegment('sub-segment') as subsegment:
subsegment.add_exception(e,stack,remote=True)
xray_recorder.end_segment()
```
The issue here is , In my amazon console . It only shows me the below exception message , But what i want is the complete trace of Exception and SQL . How is it possible ? am i trying something wrong ?
`Cause | Propagated exception caused by exception ID: e72687ae97f46e5c`

Sometime in my exception tab (AWS - XRAY CONSOLE ) there is no message , this happen when i dont define any segment or subsegment .
IMAGE ATTACHED :

Screen Shot 2020-03-25 at 6 14 05 PM

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dalla configurazione segnalata di setting.py e dalla funzione exception_logger, in particolare dai blocchi in_segment e in_subsegment relativi alla gestione di IntegrityError. Riproduci il caso con e senza un segmento definito esplicitamente, quindi esamina le voci risultanti nella console AWS X-Ray. Il lavoro è completo quando viene identificato il motivo per cui compare solo l'ID dell'eccezione propagata e se è previsto che vengano registrati l'eccezione completa e il SQL trace.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws, python
Ambito
backend, observability-sre
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.