-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: resolved esm loader issue for manual instrumentation node v18.19…
….0 and above (#1063) refs INSTA-762
- Loading branch information
1 parent
ed0e738
commit d69aff8
Showing
24 changed files
with
223 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* (c) Copyright IBM Corp. 2024 | ||
*/ | ||
|
||
/** | ||
* As of Node.js version 18.19 and above, ESM loaders (--experimental-loader) | ||
* are executed in a dedicated thread, separate from the main thread. | ||
* see https://github.com/nodejs/node/pull/44710. | ||
* Previously, loading the Instana collector within the loader and after the update ESM support | ||
* no longer working with v18.19 and above. To address this, we've opted to load the Instana | ||
* collector in the main thread using --import. | ||
* Additionally, we aim to incorporate native ESM support by utilizing the node register method, | ||
* enabling customization of the ESM loader with 'import-in-the-middle'. | ||
* | ||
* Usage: | ||
* ENV NODE_OPTIONS='--import /instana/node_modules/@instana/aws-fargate/esm-register.mjs | ||
*/ | ||
|
||
// Import the initialization module for aws-fargate collector; it self-initializes upon import | ||
// and it should be executed in the main thread. | ||
import './src/index.js'; | ||
|
||
// We plan to utilize this for adding native ESM support in the near future | ||
// import { register } from 'node:module'; | ||
// register(./loader.mjs, import.meta.url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* (c) Copyright IBM Corp. 2024 | ||
*/ | ||
|
||
/** | ||
* As of Node.js version 18.19 and above, ESM loaders (--experimental-loader) | ||
* are executed in a dedicated thread, separate from the main thread. | ||
* see https://github.com/nodejs/node/pull/44710. | ||
* Previously, loading the Instana collector within the loader and after the update ESM support | ||
* no longer working with v18.19 and above. To address this, we've opted to load the Instana | ||
* collector in the main thread using --import. Additionally, we aim to incorporate native ESM | ||
* support by utilizing the node register method, enabling customization of the ESM loader | ||
* with 'import-in-the-middle'. | ||
* | ||
* Usage: | ||
* ENV NODE_OPTIONS='--import /instana/node_modules/@instana/azure-container-services/esm-register.mjs server.js | ||
*/ | ||
|
||
// Import the initialization module for azure-container-services collector; it self-initializes upon import | ||
// and it should be executed in the main thread. | ||
import './src/index.js'; | ||
|
||
// We plan to utilize this for adding native ESM support in the near future | ||
// import { register } from 'node:module'; | ||
// register(./loader.mjs, import.meta.url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* (c) Copyright IBM Corp. 2024 | ||
*/ | ||
|
||
/** | ||
* As of Node.js version 18.19 and above, ESM loaders (--experimental-loader) | ||
* are executed in a dedicated thread, separate from the main thread. | ||
* see https://github.com/nodejs/node/pull/44710. | ||
* Previously, loading the Instana collector within the loader and after the update ESM support | ||
* no longer working with v18.19 and above. To address this, we've opted to load the Instana | ||
* collector in the main thread using --import. Additionally, we aim to incorporate native ESM | ||
* support by utilizing the node register method, enabling customization of the ESM loader | ||
* with 'import-in-the-middle'. | ||
* | ||
* Usage: | ||
* node --import @instana/collector/esm-register.mjs server.js | ||
*/ | ||
|
||
// Import the initialization module for Instana collector and it should be executed in the main thread. | ||
import instana from './src/index.js'; | ||
instana(); | ||
|
||
// We plan to utilize this for adding native ESM support in the near future | ||
// import { register } from 'node:module'; | ||
// register(./loader.mjs, import.meta.url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.