-
Notifications
You must be signed in to change notification settings - Fork 518
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
feat: report url for lambda invoked via api gateway #2404
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2404 +/- ##
==========================================
- Coverage 90.97% 90.71% -0.27%
==========================================
Files 146 156 +10
Lines 7492 7659 +167
Branches 1502 1585 +83
==========================================
+ Hits 6816 6948 +132
- Misses 676 711 +35
|
This package does not have an assigned component owner and is considered unmaintained. As such this package is in feature-freeze and this PR will be closed with 14 days unless a new owner or a sponsor (a member of @open-telemetry/javascript-approvers) for the feature is found. It is the responsibility of the author to find a sponsor for this feature. |
Could we mark |
@pichlermarc also #2403 was approved and merged a couple days ago... this lambda instrumentation is in fact under active development/maintenance. @tylerbenson your thoughts on lambda sig ownership of the various language components? |
plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
plugins/node/opentelemetry-instrumentation-aws-lambda/test/integrations/lambda-handler.test.ts
Outdated
Show resolved
Hide resolved
I'm fine with the lambda approvers taking ownership. @serkan-ozal also volunteered to own it if you'd prefer an individual vs a team. |
plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
@johnbley absolutely, we'd very much appreciate this. 🙂 The way to do is is that someone from @open-telemetry/lambda-extension-maintainers opens a component ownership request issue. I'll then open a PR to add the team there 🙂
In #2403 @dyladan acted as a feature sponsor according to the guidelines. Components are marked as "unmaintained" when there's no assigned owner. Unfortunately, we had to introduce this guideline as many contributed components (like |
plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts
Show resolved
Hide resolved
plugins/node/opentelemetry-instrumentation-aws-lambda/test/integrations/lambda-handler.test.ts
Show resolved
Hide resolved
plugins/node/opentelemetry-instrumentation-aws-lambda/test/integrations/lambda-handler.test.ts
Outdated
Show resolved
Hide resolved
plugins/node/opentelemetry-instrumentation-aws-lambda/test/integrations/lambda-handler.test.ts
Outdated
Show resolved
Hide resolved
@serkan-ozal Thanks for your careful review! |
@johnbley You're welcome and thanks for the contribution. |
'x-forwarded-proto': 'http', | ||
}, | ||
queryStringParameters: { | ||
key: 'value', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add another key/value
to test the &
addition logic from _extractFullUrl
?
describe('url parsing', () => { | ||
it('pulls url from api gateway rest events', async () => { | ||
initializeHandler('lambda-test/sync.handler'); | ||
const event = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a quick check via logging the event
from REST APIGW ---> Lambda
scenario (enabled Lambda proxy integration
)
The capitalization for some event
fields from REST APIGW are a bit different than from HTTP APIGW. (This doc also verifies some of the capitalization diffs for REST APIGW events
)
- Sampled REST APIGW event:
{
...
path: '/',
...
headers: {
...
Host: '<REST_API>.execute-api.us-west-2.amazonaws.com',
...
'X-Forwarded-For': '15.248.7.4',
'X-Forwarded-Port': '443',
'X-Forwarded-Proto': 'https'
},
...
queryStringParameters: { ghd: '356', jyi: '4568' },
...
}
- Sampled HTTP APIGW event
{
...
rawPath: '/lambda1/route2',
...
headers: {
...
host: '<HTTP_API>.execute-api.us-west-2.amazonaws.com',
...
'x-forwarded-for': '15.248.7.4',
'x-forwarded-port': '443',
'x-forwarded-proto': 'https'
},
queryStringParameters: { abc: '123', def: '456' },
...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To support REST APIGW event, can you update the URL extraction to also account for Host
, X-Forwarded-Port
, and X-Forwarded-Proto
, and then update the REST event test?
Which problem is this PR solving?
Short description of the changes
url.full
) but nothing else in this repo was, so I stuck withhttp.url