Skip to content

Conversation

@wpessers
Copy link
Contributor

@wpessers wpessers commented Nov 29, 2025

solves #2034

This change has been tested and fixes aws-lambda instrumentation again for commonjs lambda handlers using node 24 runtime.

@wpessers wpessers requested a review from a team as a code owner November 29, 2025 00:00
@wpessers wpessers added javascript Pull requests that update Javascript code bug Something isn't working labels Nov 29, 2025
@wpessers wpessers force-pushed the fix/commonjs-in-node24-runtime-lambda-instrumentation branch from 8b8447f to 4c18a20 Compare November 29, 2025 17:09
@wpessers
Copy link
Contributor Author

@serkan-ozal @pragmaticivan any thoughts about this? Also tried quickly to add a handler test like the ones we already have. But is difficult to add something "lightweight" since import-in-the-middle is loaded already in other test and you can not really "unload" it. So not so easy to isolate from the others.

If wanted, I can setup a simple unit test for the loader script. First thought to spy on the registerLoader() method but since it's esm you can't spy on it with sinon. So that would require either an extra depedency to do some sort of mocking, or a refactor of the script...

@pragmaticivan
Copy link
Member

Honestly, the change LGTM, it's simple enough, maybe worth including a comment pointing to the change in the AWS blog post. But other than that, LGTM.

@wpessers
Copy link
Contributor Author

wpessers commented Dec 1, 2025

@pragmaticivan That's a good point, it should probably be more clear in the code why we do this check. However I'm not sure there's any official AWS source on this change in the runtime. Rereading the node 24 runtime announcement from AWS I don't see this information in there (or anything hinting at it). @maxday Could you shed any light here, or point to any official resource (if exists) that we can link back to?

@pragmaticivan
Copy link
Member

pragmaticivan commented Dec 1, 2025

@pragmaticivan That's a good point, it should probably be more clear in the code why we do this check. However I'm not sure there's any official AWS source on this change in the runtime. Rereading the node 24 runtime announcement from AWS I don't see this information in there (or anything hinting at it). @maxday Could you shed any light here, or point to any official resource (if exists) that we can link back to?

https://aws.amazon.com/blogs/compute/node-js-24-runtime-now-available-in-aws-lambda/

Removing support for callback-based function handlers

I think that's the breaking change but not really sure

@wpessers
Copy link
Contributor Author

wpessers commented Dec 1, 2025

I would think the esm loading is kind of orthogonal to the removal of callback support. The blog post does mention something removal of legacy features in general in the new runtime interface client, so maybe this also involves standardization of module loading logic but I can only guess.

@serkan-ozal serkan-ozal merged commit eaf7956 into open-telemetry:main Dec 3, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants