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 include/exclude options from import-in-the-middle #5121

Open
cjpearson opened this issue Nov 7, 2024 · 0 comments · May be fixed by #5123
Open

Support include/exclude options from import-in-the-middle #5121

cjpearson opened this issue Nov 7, 2024 · 0 comments · May be fixed by #5123

Comments

@cjpearson
Copy link

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

import-in-the-middle supports providing a list of modules to include or exclude from hooking

import * as module from 'module'

// Exclude intercepting a specific module by name
module.register('import-in-the-middle/hook.mjs', import.meta.url, {
  data: { exclude: ['package-i-want-to-exclude'] }
})

// Only intercept a specific module by name
module.register('import-in-the-middle/hook.mjs', import.meta.url, {
  data: { include: ['package-i-want-to-include'] }
})

Describe the solution you'd like

This feature depends on the initialize function being registered, but it is not re-exported by the OpenTelemetry wrapper of hook.mjs.

Describe alternatives you've considered

It's also possible to use 'import-in-the-middle/hook.mjs' directly and skip '@opentelemetry/instrumentation/hook.mjs'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant