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
aws-lambda: handler never wrapped with directory index handler #679
Comments
Ping @willarmiros @NathanielRN |
Can you point to where in the instrumentation code this resolution is occurring? I think Also just want to confirm, this wasn't a regression correct? E.g. not a new behavior with instrumentation v0.26.0? |
Hello @willarmiros, Thank you for quick response!
Agree. Module resolution is quite complex (See this pseudo code: https://nodejs.org/api/modules.html#modules_all_together) One caveats with this is that
As far i know, that business logic was changed about 6 month ago. I don't think that bug is introduced from v0.26.0. |
I would like to share results: Passing "resolved file path" as name of but there's another issue: open-telemetry/opentelemetry-js#2450 is not available in current stable release. @dyladan Is there any opportunity to release patch release of @open-telemetry/instrumentation? It seems that open-telemetry/opentelemetry-js#2505 does not include experimental package. |
Experimental will be released immediately after stable. The reason is that there may be changes in the stable packages which need to be incorporated in the experimental packages. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
@mooyoul there has been a release. Is this issue now fixed? |
@dyladan Unfortunately, No. This bug still exists in latest version of aws-lambda instrumentation. but I have a fix and will propose a PR :) |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stale for 14 days with no activity. |
@mooyoul were you ever able to open that PR? |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stale for 14 days with no activity. |
What version of OpenTelemetry are you using?
What version of Node are you using?
Lambda Node.js Runtime (Currently Node.js v14.17.4)
What did you do?
Use directory index as handler location
What did you expect to see?
Handler should be instrumented
What did you see instead?
Handler never instrumented
Additional context
Current aws-lambda instrumentation assumes that given handler is file.
For example, If
api.handler
is given, instrumentation expects given handler is located at/var/task/api.js
.This breaks instrumentation working with directory index. If actual
api
module is located at/var/task/api/index.js
, Hander never wrapped because it will not match to/var/task/api.js
.Possible workaround for this is use
require.resolve
to resolve module path, or create additional InstrumentationNodeModuleDefinition for directory index. I'm not sure which way is reasonable so please share your thoughts then i will make some changes and raise a PR.The text was updated successfully, but these errors were encountered: