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

Fix parsing of v2 API Gateway headers for Lambda #2189

Closed
mrickard opened this issue May 9, 2024 · 1 comment · Fixed by #2191
Closed

Fix parsing of v2 API Gateway headers for Lambda #2189

mrickard opened this issue May 9, 2024 · 1 comment · Fixed by #2191
Assignees
Labels

Comments

@mrickard
Copy link
Member

mrickard commented May 9, 2024

Description

The Node agent automatically parses incoming HTTP headers to continue a distributed trace. In a recent test with API Gateway V2 in Lambda, the incoming trace header was not extracted from the request, and a new trace ID was generated.

This process is invoked in the wrapped handler with shim.tracer.getTransaction() (here), which leverages the transaction tracer's getTransaction method. The agent iterates over headers in the api-gateway.js file, which iterates over headers, looking for headers defined in the event-sources.json file.

Expected Behavior

The Node agent's method of detecting the incoming trace header should work seamlessly with either V2 or V1 API Gateway event payloads.

Steps to Reproduce

We'll be supplied with the test functions that were used to detect this, and we'll deploy them in the dev account. If deploying with the Serverless framework, we can specify a V2 gateway by including an event definition like this:

events:
  - httpApi:
      method: GET
      path: /

By comparison, the equivalent V1 gateway is defined with

events:
  - http: GET /

Additional context

https://new-relic.atlassian.net/browse/NR-265371

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants