Skip to content

Commit 106fa9b

Browse files
timfishpichlermarc
andauthored
fix: Update import-in-the-middle (#4745)
* fix: Update `import-in-the-middle` * changelog and lint * lint * changes from code review Co-authored-by: Marc Pichler <[email protected]> --------- Co-authored-by: Marc Pichler <[email protected]>
1 parent 315239d commit 106fa9b

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

experimental/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ All notable changes to experimental packages in this project will be documented
4141

4242
### :bug: (Bug Fix)
4343

44+
* fix(instrumentation): Update `import-in-the-middle` to fix [numerous bugs](https://github.com/DataDog/import-in-the-middle/pull/91) [#4745](https://github.com/open-telemetry/opentelemetry-js/pull/4745) @timfish
45+
4446
### :books: (Refine Doc)
4547

4648
* docs(instrumentation): better docs for supportedVersions option [#4693](https://github.com/open-telemetry/opentelemetry-js/pull/4693) @blumamir

experimental/packages/opentelemetry-instrumentation/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"dependencies": {
7575
"@opentelemetry/api-logs": "0.51.1",
7676
"@types/shimmer": "^1.0.2",
77-
"import-in-the-middle": "1.7.4",
77+
"import-in-the-middle": "1.8.0",
7878
"require-in-the-middle": "^7.1.1",
7979
"semver": "^7.5.2",
8080
"shimmer": "^1.2.1"

experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,12 +309,11 @@ export abstract class InstrumentationBase<
309309
: this._requireInTheMiddleSingleton.register(module.name, onRequire);
310310

311311
this._hooks.push(hook);
312-
const esmHook =
313-
new (ImportInTheMiddle as unknown as typeof ImportInTheMiddle.default)(
314-
[module.name],
315-
{ internals: false },
316-
<HookFn>hookFn
317-
);
312+
const esmHook = new (
313+
ImportInTheMiddle as unknown as {
314+
Hook: typeof ImportInTheMiddle.default;
315+
}
316+
).Hook([module.name], { internals: false }, <HookFn>hookFn);
318317
this._hooks.push(esmHook);
319318
}
320319
}

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)