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

[Node]: Support otel auto instrumentation when code is bundled #10940

Open
Tracked by #11070
timfish opened this issue Mar 6, 2024 · 11 comments
Open
Tracked by #11070

[Node]: Support otel auto instrumentation when code is bundled #10940

timfish opened this issue Mar 6, 2024 · 11 comments

Comments

@timfish
Copy link
Collaborator

timfish commented Mar 6, 2024

Problem Statement

OpenTelemetry auto instrumentation relies on import-in-the-middle and require-in-the-middle to hook loading of modules so they can be proxied and automatically instrumented. If the code is bundled, modules are not loaded so there is no auto instrumentation.

Solution Brainstorm

Using the Sentry bundler plugins, we can wrap the "loading" of modules and call the existing callbacks that hook up the instrumentation.

@lforst
Copy link
Member

lforst commented Mar 15, 2024

open-telemetry/opentelemetry-js#4174 DataDog/dd-trace-js@master/packages/datadog-esbuild/index.js

I can imagine so many scenarios where this esbuild plugin will break.

@drewcorlin1
Copy link

For vis: I have this PR to add an esbuild plugin for this to OTel js contrib open-telemetry/opentelemetry-js-contrib#1856

@lforst
Copy link
Member

lforst commented May 8, 2024

@drewcorlin1 huh neat. Thanks for sharing. We'll definitely investigate also creating a plugin ourselves.

@Michsior14
Copy link

Michsior14 commented Jun 13, 2024

Hey guys! Is there any ETA for providing the plugin for webpack/esbuild? This is still blocking us from migrating to v8 :/

@mydea
Copy link
Member

mydea commented Jun 13, 2024

Hey, sadly not so far! I think for now using a plugin such as mentioned/proposed by @drewcorlin1 is the way to go!

@Michsior14
Copy link

Hey, sadly not so far! I think for now using a plugin such as mentioned/proposed by @drewcorlin1 is the way to go!

Unfortunately it's only for esbuild, while I need to support webpack as well.

@mydea
Copy link
Member

mydea commented Jun 13, 2024

It's in our backlog and I'll make sure we make it part of our planning!

@Michsior14
Copy link

@mydea Any news?

@lforst
Copy link
Member

lforst commented Aug 26, 2024

@Michsior14 you'll see it here! We haven't started working on anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Product Owner
Development

No branches or pull requests

7 participants