Skip to content

Commit 198c762

Browse files
committed
docs: update
1 parent ff67150 commit 198c762

File tree

6 files changed

+20
-19
lines changed

6 files changed

+20
-19
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,9 @@ REGIONS=<region> SKIP_DOCKER_IMAGE=true BUILD_LAYER_WITH=local LAYER_NAME=experi
320320
```
321321
## ESM Support
322322

323-
We have added the ESM support for all Node.js versions, Since version 18.19, [ESM loaders are off-thread](https://github.com/nodejs/node/pull/44710), loaded separately, a shift from previous setups where the Instana collector was loaded within the loader, leading to a disruption in existing implementation. To resolve this, we've replaced the deprecated `--experimental-loader` with `--import`, facilitating the loading of the collector in the main thread. However, note that `--import` is only compatible with Node.js v18.19 and later, necessitating the maintenance of both styles for different Node.js versions.
323+
We have added the ESM support for all Node.js versions, Since version 20.6, [ESM loaders are off-thread](https://github.com/nodejs/node/pull/44710), loaded separately, a shift from previous setups where the Instana collector was loaded within the loader, leading to a disruption in existing implementation. To resolve this, we've replaced the deprecated `--experimental-loader` with `--import`, facilitating the loading of the collector in the main thread. However, note that `--import` is only compatible with Node.js v18.19 and later, necessitating the maintenance of both styles for different Node.js versions.
324324

325-
Efforts are ongoing to integrate native ESM support, detailed in ref 117183.
325+
Efforts are ongoing to integrate native ESM support, detailed in ref INSTA-807.
326326

327327
Use the following command to enable experimental ESM support:
328328

packages/aws-fargate/esm-loader.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Instead, we are using '--import' for loading instrumentation and relocated the Instana collector
1111
* loading to './esm-register' file.
1212
* Please note that '--import' flag is unavailable in earlier versions, hence we maintain both setups.
13-
* We will incorporate the native ESM support by using 'import-in-the-middle' ith register method.
13+
* In future we will incorporate the native ESM support with register method.
1414
*
1515
* Usage:
1616
* ENV NODE_OPTIONS='--experimental-loader=/instana/node_modules/

packages/aws-fargate/esm-register.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
* Previously, loading the Instana collector within the loader and after the update ESM support
1010
* no longer working with v18.19 and above. To address this, we've opted to load the Instana
1111
* collector in the main thread using --import.
12-
* Additionally, we aim to incorporate native ESM
13-
* support by utilizing the node register method, enabling customization of the ESM loader
14-
* with 'import-in-the-middle'.
12+
* Additionally, we aim to incorporate native ESM support by utilizing the node register method,
13+
* enabling customization of the ESM loader with 'import-in-the-middle'.
1514
*
1615
* Usage:
1716
* ENV NODE_OPTIONS='--import /instana/node_modules/@instana/aws-fargate/esm-register.mjs
1817
*/
19-
// We plan to utilize this for adding native ESM support in the near future
20-
// import { register } from 'node:module';
21-
// register(./loader.mjs, import.meta.url);
2218

2319
// Importing the Instana trace initialization module here, as this is executed in the main thread.
2420
import './src/index.js';
21+
22+
// We plan to utilize this for adding native ESM support in the near future
23+
// import { register } from 'node:module';
24+
// register(./loader.mjs, import.meta.url);

packages/azure-container-services/esm-register.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
* ENV NODE_OPTIONS='--import /instana/node_modules/@instana/azure-container-services/esm-register.mjs server.js
1717
*/
1818

19-
// We plan to utilize this for adding native ESM support in the near future
20-
// import { register } from 'node:module';
21-
// register(./loader.mjs, import.meta.url);
22-
2319
// Importing the Instana trace initialization module here, as this is executed in the main thread.
2420
import './src/index.js';
21+
22+
// We plan to utilize this for adding native ESM support in the near future
23+
// import { register } from 'node:module';
24+
// register(./loader.mjs, import.meta.url);

packages/collector/esm-register.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
* Usage:
1616
* node --import @instana/collector/esm-register.mjs server.js
1717
*/
18-
// We plan to utilize this for adding native ESM support in the near future
19-
// import { register } from 'node:module';
20-
// register(./loader.mjs, import.meta.url);
2118

2219
// Importing the Instana trace initialization module here, as this is executed in the main thread.
2320
import instana from './src/index.js';
2421
instana();
22+
23+
// We plan to utilize this for adding native ESM support in the near future
24+
// import { register } from 'node:module';
25+
// register(./loader.mjs, import.meta.url);

packages/google-cloud-run/esm-register.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
* ENV NODE_OPTIONS='--import /instana/node_modules/@instana/google-cloud-run/esm-register.mjs
1717
*/
1818

19+
// Importing the Instana trace initialization module here, as this is executed in the main thread.
20+
import './src/index.js';
21+
1922
// We plan to utilize this for adding native ESM support in the near future
2023
// import { register } from 'node:module';
2124
// register(./loader.mjs, import.meta.url);
22-
23-
// Importing the Instana trace initialization module here, as this is executed in the main thread.
24-
import './src/index.js';

0 commit comments

Comments
 (0)