Open drewcorlin1 opened 1 year ago
DataDog has an experimental esbuild plugin and I think a similar approach could be used for this. Is there any interest in this solution? I would be happy to begin contributing for a few packages, but I don't think I could commit to getting the plugin to work for every supported package.
Hey! I just stumped upon this and it'd be extremely helpful if there was a community solution for this @drewcorlin1
You have my +1
This would be an awesome way to approach this. It looks like DD's work is open source too, might be able to reference their work or collab: https://github.com/DataDog/dd-trace-js/blob/master/packages/datadog-esbuild/index.js
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.
Not stale
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.
being addressed here https://github.com/open-telemetry/opentelemetry-js-contrib/pull/1856
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.
Is your feature request related to a problem? Please describe.
I am attempting to use the OTel auto instrumentation for Javascript, but non-built-in modules are not patched because I am bundling my code with esbuild before deploying it into a docker container (same scenario as https://github.com/open-telemetry/opentelemetry-js/issues/2708).
Describe the solution you'd like
Provide bundler (esbuild, webpack, rollup, etc.) plugins as a means of instrumenting third party modules, since the existing
require()
-based patching does not work if you are bundling your code. This is somewhat of an alternative to https://github.com/open-telemetry/opentelemetry-js/issues/2708, with a big difference I see being that the bundler plugin could more easily apply to modules only when they're present. The proposed solution in that link seems much more manual to maintain in a codebase where we have many microservices with varying dependencies. I don't want to force developers to know they need to pass 20 aws modules to the OTel instrumentation just because they added anaws-s3
dependency.Describe alternatives you've considered
Additional context
An initial implementation of this can be found at https://github.com/open-telemetry/opentelemetry-js-contrib/pull/1856