Skip to content

Subsegment name serialization causing MissingName error #168

Closed
@Jacob-Doetsch

Description

@Jacob-Doetsch

XRay Daemon reports the following error:

xray-daemon_1  | 2019-07-28T17:35:30Z [Info] Successfully sent batch of 1 segments (0.481 seconds)
xray-daemon_1  | 2019-07-28T17:35:30Z [Error] Unprocessed segment: {
xray-daemon_1  |   ErrorCode: "MissingName",
xray-daemon_1  |   Id: "3bdcccc4799c57fa",
xray-daemon_1  |   Message: "Invalid subsegment. ErrorCode: MissingName, Cause: null"
xray-daemon_1  | }
xray-daemon_1  | 2019-07-28T17:35:30Z [Warn] Batch that contains unprocessed segments

Simple setup. Django app, using middleware. setup includes:

XRAY_RECORDER = {
    'AWS_XRAY_DAEMON_ADDRESS': 'xray-daemon:2000',
    'AWS_XRAY_TRACING_NAME': 'TheNextBigThing',
    'AWS_XRAY_CONTEXT_MISSING': 'LOG_ERROR'
}

INSTALLED_APPS = [
    ...
    'aws_xray_sdk.ext.django',
]

MIDDLEWARE = [
    'aws_xray_sdk.ext.django.middleware.XRayMiddleware',
    ...
]

I think subsegments' subsegments' names are not being serialized correctly. Below is a snippet from the XRay Daemon payload.Notice the "name": {"py/newargs": ["core/snippets/ga.html"]} name of the subsegment, which should instead be a string according to the segment JSON schema.

    ...
    "subsegments": [
        {
            ...
            "in_progress": false,
            "name": "account/login.html",
            "namespace": "local",
            "parent_id": "c572ac3f20a195dc",
            "subsegments": [
                {
                    "id": "69ef19799fec25ba",
                    "in_progress": false,
                    "name": {
                        "py/newargs": [
                            "core/snippets/ga.html"
                        ]
                    },
                    "namespace": "local",
                    "parent_id": "5ecd89473a50fa17",
                    "type": "subsegment"
                },
                ...
            ]
            ...
        }        

All SDK versions between 2.0.1 and 2.4.2 were tested and have the same issue. Same issue on Python 3.6 and 3.7 as well. Django version is 2.2.3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions