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

feat(instrumentation-aws-lambda): take care of ESM based (.mjs) handlers #2508

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

serkan-ozal
Copy link
Contributor

@serkan-ozal serkan-ozal commented Oct 28, 2024

Which problem is this PR solving?

Currently, ESM based handlers with .mjs file extension are not taken care of by AWS Lambda instrumentation, but ESM based handlers are supported since long time (https://aws.amazon.com/tr/about-aws/whats-new/2022/01/aws-lambda-es-modules-top-level-await-node-js-14/).

Short description of the changes

For the fix, while handler file is being resolved, in addition to .js and .cjs file extensions, .mjs file extension is also checked.

This PR is the contrib counter part of the open-telemetry/opentelemetry-js#5094

@serkan-ozal serkan-ozal force-pushed the fix/aws-lambda/take-care-of-esm branch from fea7f36 to 118eb8e Compare October 28, 2024 17:34
Copy link

codecov bot commented Oct 28, 2024

Codecov Report

Attention: Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review.

Project coverage is 90.56%. Comparing base (9a20e15) to head (118eb8e).

Files with missing lines Patch % Lines
...-instrumentation-aws-lambda/src/instrumentation.ts 42.85% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2508      +/-   ##
==========================================
- Coverage   90.85%   90.56%   -0.29%     
==========================================
  Files         159      154       -5     
  Lines        7853     7548     -305     
  Branches     1622     1581      -41     
==========================================
- Hits         7135     6836     -299     
+ Misses        718      712       -6     
Files with missing lines Coverage Δ
...-instrumentation-aws-lambda/src/instrumentation.ts 93.29% <42.85%> (-1.92%) ⬇️

... and 6 files with indirect coverage changes

@trentm trentm changed the title Take care of ESM based (.mjs) handlers for the AWS Lambda instrumentation feat(instrumentation-aws-lambda): take care of ESM based (.mjs) handlers Oct 28, 2024
@raphael-theriault-swi
Copy link
Contributor

Looks like a subset of #2000, thanks for addressing the issue in the instrumentation code wrt. absolute paths !

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

Successfully merging this pull request may close these issues.

2 participants