diff --git a/test/fixtures/cross_agent_tests/lambda/event_source_info.json b/test/fixtures/cross_agent_tests/lambda/event_source_info.json index 7a068e2136..e0ccfb3475 100644 --- a/test/fixtures/cross_agent_tests/lambda/event_source_info.json +++ b/test/fixtures/cross_agent_tests/lambda/event_source_info.json @@ -158,6 +158,43 @@ } } }, + "apiGatewayV2": { + "expected_type": "apiGatewayV2", + "expected_arn": null, + "event": { + "version": "2.0", + "routeKey": "ANY /nodejs-apig-function-1G3XMPLZXVXYI", + "rawPath": "/default/nodejs-apig-function-1G3XMPLZXVXYI", + "rawQueryString": "", + "cookies": [ + "s_fid=7AABXMPL1AFD9BBF-0643XMPL09956DE2", + "regStatus=pre-register" + ], + "headers": { + "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", + "accept-encoding": "gzip, deflate, br" + }, + "requestContext": { + "accountId": "123456789012", + "apiId": "r3pmxmplak", + "domainName": "r3pmxmplak.execute-api.us-east-2.amazonaws.com", + "domainPrefix": "r3pmxmplak", + "http": { + "method": "GET", + "path": "/default/nodejs-apig-function-1G3XMPLZXVXYI", + "protocol": "HTTP/1.1", + "sourceIp": "205.255.255.176", + "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36" + }, + "requestId": "JKJaXmPLvHcESHA=", + "routeKey": "ANY /nodejs-apig-function-1G3XMPLZXVXYI", + "stage": "default", + "time": "10/Mar/2020:05:16:23 +0000", + "timeEpoch": 1583817383220 + }, + "isBase64Encoded": true + } + }, "cloudFront": { "expected_type": "cloudFront", "expected_arn": null, diff --git a/test/new_relic/agent/serverless_handler_test.rb b/test/new_relic/agent/serverless_handler_test.rb index baa516065f..75d363d152 100644 --- a/test/new_relic/agent/serverless_handler_test.rb +++ b/test/new_relic/agent/serverless_handler_test.rb @@ -54,6 +54,9 @@ class ServerlessHandlerTest < Minitest::Test 'aws.lambda.eventSource.resourceId' => '123456', 'aws.lambda.eventSource.resourcePath' => '/{proxy+}', 'aws.lambda.eventSource.stage' => 'prod'}, + 'apiGatewayV2' => {'aws.lambda.eventSource.accountId' => '123456789012', + 'aws.lambda.eventSource.apiId' => 'r3pmxmplak', + 'aws.lambda.eventSource.stage' => 'default'}, 'cloudWatch_scheduled' => {'aws.lambda.eventSource.account' => '{{{account-id}}}', 'aws.lambda.eventSource.id' => 'cdc73f9d-aea9-11e3-9d5a-835b769c0d9c', 'aws.lambda.eventSource.region' => 'us-west-2',