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

Support --import flag for Node.js instrumentation #3414

Open
raphael-theriault-swi opened this issue Nov 1, 2024 · 0 comments · May be fixed by #3416
Open

Support --import flag for Node.js instrumentation #3414

raphael-theriault-swi opened this issue Nov 1, 2024 · 0 comments · May be fixed by #3416
Labels
enhancement New feature or request needs triage

Comments

@raphael-theriault-swi
Copy link

raphael-theriault-swi commented Nov 1, 2024

Component(s)

auto-instrumentation

Is your feature request related to a problem? Please describe.

Currently it's not possible to instrument a Node.js application that uses ESM, or to create a custom auto-instrumentation image with asynchronous initialisation logic, because the --require flag injected in the NODE_OPTIONS environment variable doesn't support these use cases.

Describe the solution you'd like

Adding a new useImport or similar flag to the Node.js auto-instrumentation that injects --import /otel-auto-instrumentation-nodejs/autoinstrumentation.mjs instead of --require /otel-auto-instrumentation-nodejs/autoinstrumentation.js, and adding the new file to the provided image that delegates to autoinstrumentation.js but also registers hooks for ESM instrumentation.

Describe alternatives you've considered

No response

Additional context

I'd be happy to work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant