aws / aws/aws-xray-sdk-python

subsegment not sending the Exception & SQL Trace

Offen
#211 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
stale
Vorherrschende Sprache
Python
Sterne
338
Forks
147
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit der gemeldeten setting.py-Konfiguration und der exception_logger-Funktion, insbesondere mit den Blöcken in_segment und in_subsegment rund um die Behandlung von IntegrityError. Reproduziere den Fall mit und ohne explizit definiertes Segment und untersuche anschließend die resultierenden AWS X-Ray-Konsoleneinträge. Als abgeschlossen gilt die Untersuchung, wenn geklärt ist, warum nur die weitergereichte Ausnahme-ID erscheint und ob die vollständige Ausnahme und der SQL-Trace erwartungsgemäß aufgezeichnet werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
aws, python
Bereich
backend, observability-sre
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.