Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response Streaming Lambda support #2901

Open
mrickard opened this issue Jan 23, 2025 · 1 comment
Open

Response Streaming Lambda support #2901

mrickard opened this issue Jan 23, 2025 · 1 comment
Assignees
Labels
points: 5 1-2 weeks

Comments

@mrickard
Copy link
Member

mrickard commented Jan 23, 2025

Description

AWS introduced response streaming for Node Lambda functions in 2023. Our agent's Lambda instrumentation throws errors when customers wrap these, because the argument order (event, responseStream, context) is different from the traditional functions we instrument (event, context, callback).

The .streamifyResponse method is defined for the Lambda execution environment, on the global awslambda object. When invoked, it returns the original handler function, with an additional symbol added as a property. See https://github.com/aws/aws-lambda-nodejs-runtime-interface-client/blob/main/src/UserFunction.js#L204-L213 ; the symbol is aws.lambda.runtime.handler.streaming.

We can use the presence of this property to detect automatically if the handler is intended to stream a response, and wrap it accordingly, with no additional input needed from the customer.

Acceptance Criteria

This spike should either add response streaming support, or at least determine the scale of any blockers.

@workato-integration
Copy link

@newrelic-node-agent-team newrelic-node-agent-team moved this to Triage Needed: Unprioritized Features in Node.js Engineering Board Jan 23, 2025
@mrickard mrickard added points: 5 1-2 weeks spike and removed needs-triage labels Jan 23, 2025
@kmudduluru kmudduluru moved this from Triage Needed: Unprioritized Features to Prioritized in Node.js Engineering Board Jan 24, 2025
@kmudduluru kmudduluru changed the title [Spike] Response Streaming Lambda support Response Streaming Lambda support Jan 24, 2025
@kmudduluru kmudduluru removed the spike label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
points: 5 1-2 weeks
Projects
Status: In Quarter
Development

No branches or pull requests

2 participants