Skip to content

Support AWS Lambda Response Streaming #15774

Closed

Description

@andreiborza

Description

AWS has introduced response streaming for AWS Lambda functions a while ago.

Sentry's wrapHandler is not equipped to handle this, as the parameters passed to the handler event, responseStream, context are different to the traditional event, context, [callback] parameters.

Known workarounds

While this is being worked on, you can use the following approach (thank you for providing this @JQuezada0)

export const handler = awslambda.streamifyResponse(
  async function (event, responseStream, context) {
    const sentryHandler = SentryServerless.wrapHandler(async function () {
      return sstHandlerModule.handler(event, responseStream, context);
    });

    return sentryHandler(event, context, () => undefined);
  },
);

Activity

  1. seannetlife commented on Apr 24, 2025

    @seannetlife

    in the age of ai response streaming this has bumped up significantly in terms of usefulness.

  2. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Apr 24, 2025
  3. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Apr 24, 2025
  4. self-assigned this
    on Jul 23, 2025
  5. added a commit that references this issue on Aug 27, 2025
    7303ab1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions