aws / aws/aws-xray-sdk-python

subsegment not sending the Exception & SQL Trace

Open
#211 3 comments 0 reactions 0 assignees View on GitHub
stale
Dominant language
Python
Stars
338
Forks
147
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.