Skip to content

Support AWS Lambda Response Streaming #15774

Open
@andreiborza

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);
  },
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: aws-serverlessIssues related to the Sentry AWS Serverless SDK

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions