Skip to content

subsegment not sending the Exception & SQL Trace #211

Open
@manojkumar3692

Description

@manojkumar3692

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions