-
Notifications
You must be signed in to change notification settings - Fork 407
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
Setting lambda handler is broken for API Gateway V2 Websocket lambda payloads since 12.8.1 #2857
Comments
@mark-siggins-genesys Sorry to hear you're having trouble with this. Is this a |
Sure, it is of type REQUEST. This is from a PoC stack with a websocket apigateway and very simple authorizer setup to take the Auth query param and forward it to a lambda, this is the event payload the lambda receives.
|
@mark-siggins-genesys this has been fixed in v12.10.0. please upgrade and confirm this fixes your issue |
Thanks @bizob2828 - v12.10.0 has fixed this issue. Much appreciated. |
Instrumenting lambda functions which process API Gateway V2 Websocket Authorizer calls causes invocation failures since 12.8.1
This was working prior to that.
Description
Using the
newrelic.setLambdaHandler
on the handler function for an APIgatewayV2 websocket Authorizer lambda function with an event of TypeAPIGatewayRequestAuthorizerEvent
causes the following runtime errorThe payload shape for this use case can be seen here:
https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-lambda-auth.html
Expected Behavior
setting the lambda handler does not throw errors
Steps to Reproduce
Setup a websocket APIGateway, add a lambda as an authorizer and attempt to connect to the wss address. The lambda invocation will fail with the error seen above.
You can see tests fail if you provide the payload shape from https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-lambda-auth.html and use them in the tests identifying APIGateway events - eg
https://github.com/newrelic/node-newrelic/blob/main/test/unit/serverless/utils.test.js#L34
Your Environment
AWS APIGatewayV2 Websocket Authorizer nodejs lambda
Additional context
I think this is related to this ticket - #2780
The event payload seems to be identified as isGatewayV1Event but because there is no event.path this causes problems further on when the url pathname is expected to be present.
The text was updated successfully, but these errors were encountered: