Skip to content

Segment exceptions are not assigned an ID #473

@michaelskahn

Description

@michaelskahn

Summary

The exception object documentation describes the fields of exception objects in segments. According to this spec, "All fields are optional except id." This SDK doesn't set the ID property on exception objects, causing messages to be out of spec and cause downstream errors.

Details

The CapturedException class represents an exception in the SDK. Its constructor defines several of the specified fields, but does not assign an ID. This appears to be different behavior than the other X-Ray SDKs (Java, Python).

Exceptions objects created by this SDK look like:

"exceptions":[{"message":"Not Found","type":"Error","stack":[...],"remote":false}]

when they should (if I understand the docs) look like

"exceptions":[{"id": "abcdabcdabcdabcd", "message":"Not Found","type":"Error","stack":[...],"remote":false}]

One impact of this difference is that messages generated by this SDK and sent to the awsxray otel collector result in a segfault in the collector when it tries to read the ID.

Proposed Solution

Add an ID assignment to the CapturedException constructor, or somewhere else appropriate.

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