Skip to content

LocalVariables integration does not capture full nested object payload in AWS Lambda (even when serializable) #109638

@ReneGreen27

Description

@ReneGreen27

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

Using @sentry/aws-serverless v10.36.0 in AWS Lambda

includeLocalVariables: true

Added custom localVariablesIntegration({ includeOutOfAppFrames: true })

extraErrorDataIntegration() also enabled

Threw an error at a point close to the request source (using undici)

Attempted to increase normalizeDepth

Logged payload locally and via JSON.parse(JSON.stringify(payload))

Expected Result

Fully serializable nested object should appear in Local Variables

Same object appears in full if attached via extra

Ideally, Local Variables capture should either preserve full object or clearly document any depth/size limits

Actual Result

Nested object is truncated or missing in Local Variables

Logging locally shows full object

JSON.parse(JSON.stringify(payload)) preserves entire object

Attaching via extra shows the complete payload in Sentry

Increasing normalizeDepth does not change Local Variables capture

No debug warnings about truncation are emitted

Things tried:

  • Enabled includeLocalVariables: true in @sentry/aws-serverless

  • Added a custom localVariablesIntegration({ includeOutOfAppFrames: true })

  • Added extraErrorDataIntegration()

  • Increased normalizeDepth

  • Logged payload locally -> confirmed full object exists

  • Serialized payload via JSON.parse(JSON.stringify(payload)) -> confirmed full object

  • Verified payload_debug sent via extra -> full object appears in Sentry

  • Tested throwing error close to request source (undici)

  • Checked debug logs -> no warnings or truncation messages

  • Considered Lambda async boundary / flush issues

Looks similar to:

Related to internal ticket #173815

Product Area

Issues

Link

No response

DSN

No response

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Waiting for: Support

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions