From ab52a8420ab8967195aacfaf8b6e37df9cb50b07 Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Wed, 15 Nov 2023 11:12:37 -0500 Subject: [PATCH 01/10] [next] deprecate 14,16 and support 20 --- .github/workflows/benchmark.yml | 2 +- .github/workflows/unit-test.yml | 16 +-- examples/basic-tracer-node/package.json | 2 +- examples/esm-http-ts/package.json | 2 +- examples/grpc-js/package.json | 2 +- examples/http/package.json | 2 +- examples/https/package.json | 2 +- examples/opentelemetry-web/package.json | 2 +- examples/opentracing-shim/package.json | 2 +- examples/otlp-exporter-node/package.json | 2 +- .../node14/package.json | 2 +- .../node16/package.json | 2 +- .../examples/opencensus-shim/package.json | 2 +- experimental/packages/api-events/package.json | 2 +- experimental/packages/api-logs/package.json | 2 +- .../exporter-logs-otlp-grpc/package.json | 2 +- .../exporter-logs-otlp-http/package.json | 2 +- .../exporter-logs-otlp-proto/package.json | 2 +- .../exporter-trace-otlp-grpc/package.json | 2 +- .../exporter-trace-otlp-http/package.json | 2 +- .../exporter-trace-otlp-proto/package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../opentelemetry-sdk-node/package.json | 2 +- .../packages/otlp-exporter-base/package.json | 2 +- .../otlp-grpc-exporter-base/package.json | 2 +- .../otlp-proto-exporter-base/package.json | 2 +- .../packages/otlp-transformer/package.json | 2 +- experimental/packages/sdk-logs/package.json | 2 +- .../packages/shim-opencensus/package.json | 2 +- .../package.json | 2 +- package-lock.json | 102 +++++++++--------- .../package.json | 2 +- .../package.json | 2 +- .../opentelemetry-context-zone/package.json | 2 +- packages/opentelemetry-core/package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../opentelemetry-propagator-b3/package.json | 2 +- .../package.json | 2 +- packages/opentelemetry-resources/package.json | 2 +- .../opentelemetry-sdk-trace-base/package.json | 2 +- .../opentelemetry-sdk-trace-node/package.json | 2 +- .../opentelemetry-sdk-trace-web/package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- packages/sdk-metrics/package.json | 2 +- packages/template/package.json | 2 +- selenium-tests/package.json | 2 +- 57 files changed, 111 insertions(+), 117 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index b847bc2d3e..1f9376d610 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: node_version: - - "18" + - "20" runs-on: self-hosted timeout-minutes: 10 env: diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index ffebc82c29..46ff06e60f 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -12,9 +12,8 @@ jobs: fail-fast: false matrix: node_version: - - "14" - - "16" - "18" + - "20" runs-on: ubuntu-latest env: NPM_CONFIG_UNSAFE_PERM: true @@ -27,11 +26,6 @@ jobs: node-version: ${{ matrix.node_version }} - run: npm install -g npm@latest - if: ${{ matrix.node_version == '18' || matrix.node_version == '20' }} - - # npm@10.0.0 drops support for Node.js v14 and v16 - - run: npm install -g npm@"<10.0.0" - if: ${{ matrix.node_version == '14' || matrix.node_version == '16' }} - name: Bootstrap run: npm ci @@ -42,13 +36,11 @@ jobs: - name: Unit tests run: | # TODO(legendecas): webpack https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported - if [ "${{ matrix.node_version }}" = "18" ]; then - export NODE_OPTIONS=--openssl-legacy-provider - fi + export NODE_OPTIONS=--openssl-legacy-provider npm run test - name: Report Coverage run: npm run codecov - if: ${{ matrix.node_version == '14' }} + if: ${{ matrix.node_version == '20' }} node-windows-tests: runs-on: windows-latest env: @@ -126,6 +118,8 @@ jobs: - "8" - "10" - "12" + - "14" + - "16" runs-on: ubuntu-latest steps: - name: Checkout diff --git a/examples/basic-tracer-node/package.json b/examples/basic-tracer-node/package.json index 6219894855..2012f1f3b1 100644 --- a/examples/basic-tracer-node/package.json +++ b/examples/basic-tracer-node/package.json @@ -16,7 +16,7 @@ "tracing" ], "engines": { - "node": ">=14" + "node": ">=18" }, "author": "OpenTelemetry Authors", "license": "Apache-2.0", diff --git a/examples/esm-http-ts/package.json b/examples/esm-http-ts/package.json index 12897fa6a7..21641b17c2 100644 --- a/examples/esm-http-ts/package.json +++ b/examples/esm-http-ts/package.json @@ -21,7 +21,7 @@ "typescript" ], "engines": { - "node": ">=14" + "node": ">=18" }, "author": "OpenTelemetry Authors", "license": "Apache-2.0", diff --git a/examples/grpc-js/package.json b/examples/grpc-js/package.json index 99dc941919..6cbd02c014 100644 --- a/examples/grpc-js/package.json +++ b/examples/grpc-js/package.json @@ -20,7 +20,7 @@ "tracing" ], "engines": { - "node": ">=14" + "node": ">=18" }, "author": "OpenTelemetry Authors", "license": "Apache-2.0", diff --git a/examples/http/package.json b/examples/http/package.json index 06899fd23a..12c1a82982 100644 --- a/examples/http/package.json +++ b/examples/http/package.json @@ -20,7 +20,7 @@ "tracing" ], "engines": { - "node": ">=14" + "node": ">=18" }, "author": "OpenTelemetry Authors", "license": "Apache-2.0", diff --git a/examples/https/package.json b/examples/https/package.json index cebf2cc00c..ab0ce6de45 100644 --- a/examples/https/package.json +++ b/examples/https/package.json @@ -24,7 +24,7 @@ "tracing" ], "engines": { - "node": ">=14" + "node": ">=18" }, "author": "OpenTelemetry Authors", "license": "Apache-2.0", diff --git a/examples/opentelemetry-web/package.json b/examples/opentelemetry-web/package.json index 04c723218d..0ce0ea213b 100644 --- a/examples/opentelemetry-web/package.json +++ b/examples/opentelemetry-web/package.json @@ -24,7 +24,7 @@ "web" ], "engines": { - "node": ">=14" + "node": ">=18" }, "author": "OpenTelemetry Authors", "license": "Apache-2.0", diff --git a/examples/opentracing-shim/package.json b/examples/opentracing-shim/package.json index cf880f2b19..9895029b43 100644 --- a/examples/opentracing-shim/package.json +++ b/examples/opentracing-shim/package.json @@ -21,7 +21,7 @@ "opentracing" ], "engines": { - "node": ">=14" + "node": ">=18" }, "author": "OpenTelemetry Authors", "license": "Apache-2.0", diff --git a/examples/otlp-exporter-node/package.json b/examples/otlp-exporter-node/package.json index 57a8a72cd0..e7578b8b1e 100644 --- a/examples/otlp-exporter-node/package.json +++ b/examples/otlp-exporter-node/package.json @@ -20,7 +20,7 @@ "tracing" ], "engines": { - "node": ">=14" + "node": ">=18" }, "author": "OpenTelemetry Authors", "license": "Apache-2.0", diff --git a/experimental/backwards-compatibility/node14/package.json b/experimental/backwards-compatibility/node14/package.json index acf9ca85cd..66ffd91b28 100644 --- a/experimental/backwards-compatibility/node14/package.json +++ b/experimental/backwards-compatibility/node14/package.json @@ -19,6 +19,6 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" } } diff --git a/experimental/backwards-compatibility/node16/package.json b/experimental/backwards-compatibility/node16/package.json index 932dcfacae..fdb37e7ee5 100644 --- a/experimental/backwards-compatibility/node16/package.json +++ b/experimental/backwards-compatibility/node16/package.json @@ -19,6 +19,6 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" } } diff --git a/experimental/examples/opencensus-shim/package.json b/experimental/examples/opencensus-shim/package.json index 79570efc75..f3eb091759 100644 --- a/experimental/examples/opencensus-shim/package.json +++ b/experimental/examples/opencensus-shim/package.json @@ -19,7 +19,7 @@ "opencensus" ], "engines": { - "node": ">=14" + "node": ">=18" }, "author": "OpenTelemetry Authors", "license": "Apache-2.0", diff --git a/experimental/packages/api-events/package.json b/experimental/packages/api-events/package.json index bd1cbf7193..7ffba8178a 100644 --- a/experimental/packages/api-events/package.json +++ b/experimental/packages/api-events/package.json @@ -41,7 +41,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/experimental/packages/api-logs/package.json b/experimental/packages/api-logs/package.json index c9aa4abc5b..bc75e71dd8 100644 --- a/experimental/packages/api-logs/package.json +++ b/experimental/packages/api-logs/package.json @@ -41,7 +41,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/experimental/packages/exporter-logs-otlp-grpc/package.json b/experimental/packages/exporter-logs-otlp-grpc/package.json index d6e2d5a029..6d24a2a37e 100644 --- a/experimental/packages/exporter-logs-otlp-grpc/package.json +++ b/experimental/packages/exporter-logs-otlp-grpc/package.json @@ -33,7 +33,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/src/**/*.js", diff --git a/experimental/packages/exporter-logs-otlp-http/package.json b/experimental/packages/exporter-logs-otlp-http/package.json index d2713abdfd..1e2f6f50ea 100644 --- a/experimental/packages/exporter-logs-otlp-http/package.json +++ b/experimental/packages/exporter-logs-otlp-http/package.json @@ -26,7 +26,7 @@ "url": "https://github.com/open-telemetry/opentelemetry-js/issues" }, "engines": { - "node": ">=14" + "node": ">=18" }, "scripts": { "prepublishOnly": "npm run compile", diff --git a/experimental/packages/exporter-logs-otlp-proto/package.json b/experimental/packages/exporter-logs-otlp-proto/package.json index af2c34d04a..0f26bd7b1f 100644 --- a/experimental/packages/exporter-logs-otlp-proto/package.json +++ b/experimental/packages/exporter-logs-otlp-proto/package.json @@ -42,7 +42,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/experimental/packages/exporter-trace-otlp-grpc/package.json b/experimental/packages/exporter-trace-otlp-grpc/package.json index 51994bb73c..75da09efa1 100644 --- a/experimental/packages/exporter-trace-otlp-grpc/package.json +++ b/experimental/packages/exporter-trace-otlp-grpc/package.json @@ -32,7 +32,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/src/**/*.js", diff --git a/experimental/packages/exporter-trace-otlp-http/package.json b/experimental/packages/exporter-trace-otlp-http/package.json index b263499123..121588f970 100644 --- a/experimental/packages/exporter-trace-otlp-http/package.json +++ b/experimental/packages/exporter-trace-otlp-http/package.json @@ -43,7 +43,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/experimental/packages/exporter-trace-otlp-proto/package.json b/experimental/packages/exporter-trace-otlp-proto/package.json index a1daddfe14..66dbaab94d 100644 --- a/experimental/packages/exporter-trace-otlp-proto/package.json +++ b/experimental/packages/exporter-trace-otlp-proto/package.json @@ -41,7 +41,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/experimental/packages/opentelemetry-browser-detector/package.json b/experimental/packages/opentelemetry-browser-detector/package.json index da732e79b2..c091a6f0c3 100644 --- a/experimental/packages/opentelemetry-browser-detector/package.json +++ b/experimental/packages/opentelemetry-browser-detector/package.json @@ -33,7 +33,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json index da7712c70d..09cff6e54a 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json @@ -32,7 +32,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/src/**/*.js", diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json index aac172354d..c280d8c825 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json @@ -43,7 +43,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json index bbaf908ba6..790800ab28 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json @@ -34,7 +34,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/experimental/packages/opentelemetry-exporter-prometheus/package.json b/experimental/packages/opentelemetry-exporter-prometheus/package.json index 34c659d9af..0529cbbebd 100644 --- a/experimental/packages/opentelemetry-exporter-prometheus/package.json +++ b/experimental/packages/opentelemetry-exporter-prometheus/package.json @@ -29,7 +29,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/src/**/*.js", diff --git a/experimental/packages/opentelemetry-instrumentation-fetch/package.json b/experimental/packages/opentelemetry-instrumentation-fetch/package.json index cb0221f7d6..87cd7be4c3 100644 --- a/experimental/packages/opentelemetry-instrumentation-fetch/package.json +++ b/experimental/packages/opentelemetry-instrumentation-fetch/package.json @@ -34,7 +34,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/experimental/packages/opentelemetry-instrumentation-grpc/package.json b/experimental/packages/opentelemetry-instrumentation-grpc/package.json index 7a7bf5db8d..f12b0fb542 100644 --- a/experimental/packages/opentelemetry-instrumentation-grpc/package.json +++ b/experimental/packages/opentelemetry-instrumentation-grpc/package.json @@ -32,7 +32,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/src/**/*.js", diff --git a/experimental/packages/opentelemetry-instrumentation-http/package.json b/experimental/packages/opentelemetry-instrumentation-http/package.json index 6ab78ab400..7f0e126a9a 100644 --- a/experimental/packages/opentelemetry-instrumentation-http/package.json +++ b/experimental/packages/opentelemetry-instrumentation-http/package.json @@ -31,7 +31,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/src/**/*.js", diff --git a/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json b/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json index b51a06bbae..76b9021a30 100644 --- a/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json +++ b/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json @@ -34,7 +34,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/experimental/packages/opentelemetry-instrumentation/package.json b/experimental/packages/opentelemetry-instrumentation/package.json index e281c68bc4..94033b365f 100644 --- a/experimental/packages/opentelemetry-instrumentation/package.json +++ b/experimental/packages/opentelemetry-instrumentation/package.json @@ -112,7 +112,7 @@ "webpack-merge": "5.9.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "sideEffects": false } diff --git a/experimental/packages/opentelemetry-sdk-node/package.json b/experimental/packages/opentelemetry-sdk-node/package.json index 620bef5284..690bcb9a16 100644 --- a/experimental/packages/opentelemetry-sdk-node/package.json +++ b/experimental/packages/opentelemetry-sdk-node/package.json @@ -31,7 +31,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/src/**/*.js", diff --git a/experimental/packages/otlp-exporter-base/package.json b/experimental/packages/otlp-exporter-base/package.json index e6ab9872d1..4ec2d555b6 100644 --- a/experimental/packages/otlp-exporter-base/package.json +++ b/experimental/packages/otlp-exporter-base/package.json @@ -42,7 +42,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/experimental/packages/otlp-grpc-exporter-base/package.json b/experimental/packages/otlp-grpc-exporter-base/package.json index f593f04df3..bdc0ba0613 100644 --- a/experimental/packages/otlp-grpc-exporter-base/package.json +++ b/experimental/packages/otlp-grpc-exporter-base/package.json @@ -34,7 +34,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/src/**/*.js", diff --git a/experimental/packages/otlp-proto-exporter-base/package.json b/experimental/packages/otlp-proto-exporter-base/package.json index a396ff19ca..362d121b1e 100644 --- a/experimental/packages/otlp-proto-exporter-base/package.json +++ b/experimental/packages/otlp-proto-exporter-base/package.json @@ -39,7 +39,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/experimental/packages/otlp-transformer/package.json b/experimental/packages/otlp-transformer/package.json index 04ee4c802e..ac219640fd 100644 --- a/experimental/packages/otlp-transformer/package.json +++ b/experimental/packages/otlp-transformer/package.json @@ -39,7 +39,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/experimental/packages/sdk-logs/package.json b/experimental/packages/sdk-logs/package.json index 052e6f07b2..d5b614bc5b 100644 --- a/experimental/packages/sdk-logs/package.json +++ b/experimental/packages/sdk-logs/package.json @@ -26,7 +26,7 @@ "url": "https://github.com/open-telemetry/opentelemetry-js/issues" }, "engines": { - "node": ">=14" + "node": ">=18" }, "scripts": { "prepublishOnly": "npm run compile", diff --git a/experimental/packages/shim-opencensus/package.json b/experimental/packages/shim-opencensus/package.json index 3e01691949..f1840f8d2a 100644 --- a/experimental/packages/shim-opencensus/package.json +++ b/experimental/packages/shim-opencensus/package.json @@ -34,7 +34,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/src/**/*.js", diff --git a/integration-tests/propagation-validation-server/package.json b/integration-tests/propagation-validation-server/package.json index d3c8aa0de4..0d9b204796 100644 --- a/integration-tests/propagation-validation-server/package.json +++ b/integration-tests/propagation-validation-server/package.json @@ -23,6 +23,6 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" } } diff --git a/package-lock.json b/package-lock.json index 7347eb6c21..0cf52dcda7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -173,7 +173,7 @@ "@opentelemetry/semantic-conventions": "1.18.1" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "examples/http": { @@ -195,7 +195,7 @@ "cross-env": "^6.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "examples/https": { @@ -217,7 +217,7 @@ "cross-env": "^6.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "examples/opentelemetry-web": { @@ -252,7 +252,7 @@ "webpack-merge": "^5.8.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "examples/opentelemetry-web/node_modules/@webassemblyjs/ast": { @@ -582,7 +582,7 @@ "@opentelemetry/semantic-conventions": "1.18.1" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "experimental/backwards-compatibility/node14": { @@ -598,7 +598,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "experimental/backwards-compatibility/node14/node_modules/@types/node": { @@ -620,7 +620,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "experimental/backwards-compatibility/node16/node_modules/@types/node": { @@ -732,7 +732,7 @@ "@opentelemetry/shim-opencensus": "0.45.1" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "experimental/examples/prometheus": { @@ -774,7 +774,7 @@ "webpack": "4.46.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "experimental/packages/api-events/node_modules/terser-webpack-plugin": { @@ -878,7 +878,7 @@ "webpack": "4.46.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "experimental/packages/api-logs/node_modules/terser-webpack-plugin": { @@ -986,7 +986,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0" @@ -1073,7 +1073,7 @@ "webpack-merge": "5.9.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0" @@ -1245,7 +1245,7 @@ "webpack-merge": "5.9.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0" @@ -1407,7 +1407,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0" @@ -1493,7 +1493,7 @@ "webpack-merge": "5.9.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0" @@ -1663,7 +1663,7 @@ "webpack-merge": "5.9.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0" @@ -1828,7 +1828,7 @@ "webpack-merge": "5.9.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0" @@ -1990,7 +1990,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" @@ -2076,7 +2076,7 @@ "webpack-merge": "5.9.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" @@ -2237,7 +2237,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" @@ -2307,7 +2307,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" @@ -2356,7 +2356,7 @@ "webpack-merge": "5.9.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" @@ -2404,7 +2404,7 @@ "webpack-merge": "5.9.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0" @@ -2569,7 +2569,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" @@ -2612,7 +2612,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" @@ -2671,7 +2671,7 @@ "webpack-merge": "5.9.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0" @@ -2964,7 +2964,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": ">=1.3.0 <1.8.0" @@ -3004,7 +3004,7 @@ "webpack-merge": "5.9.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0" @@ -3166,7 +3166,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0" @@ -3238,7 +3238,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0" @@ -3317,7 +3317,7 @@ "webpack": "4.46.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": ">=1.3.0 <1.8.0" @@ -3431,7 +3431,7 @@ "webpack-merge": "5.9.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": ">=1.4.0 <1.8.0", @@ -3591,7 +3591,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opencensus/core": "^0.1.0", @@ -3614,7 +3614,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "integration-tests/propagation-validation-server/node_modules/axios": { @@ -34057,7 +34057,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.8.0" @@ -34097,7 +34097,7 @@ "webpack-merge": "5.9.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "packages/opentelemetry-context-zone-peer-dep": { @@ -34134,7 +34134,7 @@ "zone.js": "0.11.4" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.8.0", @@ -34417,7 +34417,7 @@ "webpack": "4.46.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.8.0" @@ -34522,7 +34522,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0" @@ -34568,7 +34568,7 @@ "webpack-merge": "5.9.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0" @@ -34719,7 +34719,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.8.0" @@ -34757,7 +34757,7 @@ "webpack": "4.46.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.8.0" @@ -34871,7 +34871,7 @@ "webpack-merge": "5.9.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.8.0" @@ -35038,7 +35038,7 @@ "webpack": "4.46.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.8.0" @@ -35146,7 +35146,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.8.0" @@ -35196,7 +35196,7 @@ "webpack-merge": "5.9.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.8.0" @@ -35345,7 +35345,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "packages/opentelemetry-shim-opentracing": { @@ -35373,7 +35373,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.8.0" @@ -35416,7 +35416,7 @@ "webpack-merge": "5.9.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": ">=1.3.0 <1.8.0" @@ -35557,7 +35557,7 @@ "typescript": "4.4.4" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "selenium-tests": { @@ -35600,7 +35600,7 @@ "webpack-merge": "5.9.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0" diff --git a/packages/opentelemetry-context-async-hooks/package.json b/packages/opentelemetry-context-async-hooks/package.json index 7849fab284..b8133367de 100644 --- a/packages/opentelemetry-context-async-hooks/package.json +++ b/packages/opentelemetry-context-async-hooks/package.json @@ -30,7 +30,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/src/**/*.js", diff --git a/packages/opentelemetry-context-zone-peer-dep/package.json b/packages/opentelemetry-context-zone-peer-dep/package.json index af890066ae..9c7df4eb51 100644 --- a/packages/opentelemetry-context-zone-peer-dep/package.json +++ b/packages/opentelemetry-context-zone-peer-dep/package.json @@ -33,7 +33,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/packages/opentelemetry-context-zone/package.json b/packages/opentelemetry-context-zone/package.json index 335b12643c..5298839d4e 100644 --- a/packages/opentelemetry-context-zone/package.json +++ b/packages/opentelemetry-context-zone/package.json @@ -30,7 +30,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/packages/opentelemetry-core/package.json b/packages/opentelemetry-core/package.json index eb9778e9c1..5105f85c53 100644 --- a/packages/opentelemetry-core/package.json +++ b/packages/opentelemetry-core/package.json @@ -44,7 +44,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/packages/opentelemetry-exporter-jaeger/package.json b/packages/opentelemetry-exporter-jaeger/package.json index 103bf1a1cb..c84a13bd3a 100644 --- a/packages/opentelemetry-exporter-jaeger/package.json +++ b/packages/opentelemetry-exporter-jaeger/package.json @@ -30,7 +30,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/src/**/*.js", diff --git a/packages/opentelemetry-exporter-zipkin/package.json b/packages/opentelemetry-exporter-zipkin/package.json index 27a1890429..0cbb258c1c 100644 --- a/packages/opentelemetry-exporter-zipkin/package.json +++ b/packages/opentelemetry-exporter-zipkin/package.json @@ -40,7 +40,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/packages/opentelemetry-propagator-b3/package.json b/packages/opentelemetry-propagator-b3/package.json index 66fb2a05b6..5ab4769d7d 100644 --- a/packages/opentelemetry-propagator-b3/package.json +++ b/packages/opentelemetry-propagator-b3/package.json @@ -32,7 +32,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/packages/opentelemetry-propagator-jaeger/package.json b/packages/opentelemetry-propagator-jaeger/package.json index 38c8c33296..7dc15515d6 100644 --- a/packages/opentelemetry-propagator-jaeger/package.json +++ b/packages/opentelemetry-propagator-jaeger/package.json @@ -34,7 +34,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/packages/opentelemetry-resources/package.json b/packages/opentelemetry-resources/package.json index 21653a9c9d..41085616cd 100644 --- a/packages/opentelemetry-resources/package.json +++ b/packages/opentelemetry-resources/package.json @@ -41,7 +41,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/packages/opentelemetry-sdk-trace-base/package.json b/packages/opentelemetry-sdk-trace-base/package.json index c5d1a79920..5465399b8c 100644 --- a/packages/opentelemetry-sdk-trace-base/package.json +++ b/packages/opentelemetry-sdk-trace-base/package.json @@ -45,7 +45,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/packages/opentelemetry-sdk-trace-node/package.json b/packages/opentelemetry-sdk-trace-node/package.json index f3250f6108..e441d538d4 100644 --- a/packages/opentelemetry-sdk-trace-node/package.json +++ b/packages/opentelemetry-sdk-trace-node/package.json @@ -31,7 +31,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/src/**/*.js", diff --git a/packages/opentelemetry-sdk-trace-web/package.json b/packages/opentelemetry-sdk-trace-web/package.json index 60fc85190c..f91c3659ef 100644 --- a/packages/opentelemetry-sdk-trace-web/package.json +++ b/packages/opentelemetry-sdk-trace-web/package.json @@ -35,7 +35,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/packages/opentelemetry-semantic-conventions/package.json b/packages/opentelemetry-semantic-conventions/package.json index 73f1bcc849..53c12c3a95 100644 --- a/packages/opentelemetry-semantic-conventions/package.json +++ b/packages/opentelemetry-semantic-conventions/package.json @@ -29,7 +29,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/packages/opentelemetry-shim-opentracing/package.json b/packages/opentelemetry-shim-opentracing/package.json index 7315f92417..37f7688638 100644 --- a/packages/opentelemetry-shim-opentracing/package.json +++ b/packages/opentelemetry-shim-opentracing/package.json @@ -28,7 +28,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/src/**/*.js", diff --git a/packages/sdk-metrics/package.json b/packages/sdk-metrics/package.json index 952531ac43..1fe8718fe8 100644 --- a/packages/sdk-metrics/package.json +++ b/packages/sdk-metrics/package.json @@ -34,7 +34,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "files": [ "build/esm/**/*.js", diff --git a/packages/template/package.json b/packages/template/package.json index 111dff0c20..a2746412c7 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -23,7 +23,7 @@ "url": "https://github.com/open-telemetry/opentelemetry-js/issues" }, "engines": { - "node": ">=14" + "node": ">=18" }, "scripts": { "prepublishOnly": "npm run compile", diff --git a/selenium-tests/package.json b/selenium-tests/package.json index 5e0c7a361c..546412398f 100644 --- a/selenium-tests/package.json +++ b/selenium-tests/package.json @@ -25,7 +25,7 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": ">=18" }, "publishConfig": { "access": "restricted" From 9d62673d2c3223243c6d18af6ddcf7b233264b50 Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Wed, 15 Nov 2023 15:40:24 -0500 Subject: [PATCH 02/10] Fix prom test for node 20 --- .../test/PrometheusExporter.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/experimental/packages/opentelemetry-exporter-prometheus/test/PrometheusExporter.test.ts b/experimental/packages/opentelemetry-exporter-prometheus/test/PrometheusExporter.test.ts index b4c6f0ade0..1030203a2c 100644 --- a/experimental/packages/opentelemetry-exporter-prometheus/test/PrometheusExporter.test.ts +++ b/experimental/packages/opentelemetry-exporter-prometheus/test/PrometheusExporter.test.ts @@ -360,8 +360,8 @@ describe('PrometheusExporter', () => { .get('http://localhost:9464/metrics', res => { errorHandler(done)(new Error('unreachable')); }) - .on('error', err => { - assert(`${err}`.match('ECONNREFUSED')); + .on('error', (err: any) => { + assert.equal(err.code, 'ECONNREFUSED'); done(); }); }); From 7cf46c794b5f4f36e5f73fbaa515e89c91e43b58 Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Thu, 16 Nov 2023 14:45:21 -0500 Subject: [PATCH 03/10] Name exports to fix ESM tests --- .../opentelemetry-instrumentation/src/index.ts | 8 +++++++- .../src/platform/index.ts | 8 +++++++- .../src/platform/node/index.ts | 11 +++++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/experimental/packages/opentelemetry-instrumentation/src/index.ts b/experimental/packages/opentelemetry-instrumentation/src/index.ts index 8420c6968e..9a95b9c381 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/index.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/index.ts @@ -15,7 +15,13 @@ */ export * from './autoLoader'; -export * from './platform/index'; +export { + InstrumentationBase, + InstrumentationModuleDefinition, + InstrumentationModuleFile, + InstrumentationNodeModuleDefinition, + InstrumentationNodeModuleFile +} from './platform/index'; export * from './types'; export * from './types_internal'; export * from './utils'; diff --git a/experimental/packages/opentelemetry-instrumentation/src/platform/index.ts b/experimental/packages/opentelemetry-instrumentation/src/platform/index.ts index cdaf8858ce..7e5d3dc820 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/platform/index.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/platform/index.ts @@ -14,4 +14,10 @@ * limitations under the License. */ -export * from './node'; +export { + InstrumentationBase, + InstrumentationModuleDefinition, + InstrumentationModuleFile, + InstrumentationNodeModuleDefinition, + InstrumentationNodeModuleFile +} from './node'; diff --git a/experimental/packages/opentelemetry-instrumentation/src/platform/node/index.ts b/experimental/packages/opentelemetry-instrumentation/src/platform/node/index.ts index 842797c341..bc3a8c3fa6 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/platform/node/index.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/platform/node/index.ts @@ -13,7 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export * from './instrumentation'; -export * from './instrumentationNodeModuleDefinition'; -export * from './instrumentationNodeModuleFile'; -export * from './types'; +export { InstrumentationBase } from './instrumentation'; +export { InstrumentationNodeModuleDefinition } from './instrumentationNodeModuleDefinition'; +export { InstrumentationNodeModuleFile } from './instrumentationNodeModuleFile'; +export { + InstrumentationModuleDefinition, + InstrumentationModuleFile +} from './types'; From d229b3ad31409c31cb75e7a598ec996a138842e9 Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Fri, 17 Nov 2023 08:35:48 -0500 Subject: [PATCH 04/10] Temporarily disable node 20 --- .github/workflows/unit-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 46ff06e60f..0e57c355ce 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -13,7 +13,7 @@ jobs: matrix: node_version: - "18" - - "20" + # - "20" # disabled until http instrumentation can be fixed runs-on: ubuntu-latest env: NPM_CONFIG_UNSAFE_PERM: true @@ -40,7 +40,7 @@ jobs: npm run test - name: Report Coverage run: npm run codecov - if: ${{ matrix.node_version == '20' }} + if: ${{ matrix.node_version == '18' }} node-windows-tests: runs-on: windows-latest env: From 343ca78015e967bc2b05e0d8d3db92cd6919131e Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Fri, 17 Nov 2023 13:56:52 -0500 Subject: [PATCH 05/10] lint --- .../opentelemetry-instrumentation/src/index.ts | 10 +++++----- .../src/platform/index.ts | 10 +++++----- .../src/platform/node/index.ts | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/experimental/packages/opentelemetry-instrumentation/src/index.ts b/experimental/packages/opentelemetry-instrumentation/src/index.ts index 9a95b9c381..5f9b47c138 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/index.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/index.ts @@ -16,11 +16,11 @@ export * from './autoLoader'; export { - InstrumentationBase, - InstrumentationModuleDefinition, - InstrumentationModuleFile, - InstrumentationNodeModuleDefinition, - InstrumentationNodeModuleFile + InstrumentationBase, + InstrumentationModuleDefinition, + InstrumentationModuleFile, + InstrumentationNodeModuleDefinition, + InstrumentationNodeModuleFile, } from './platform/index'; export * from './types'; export * from './types_internal'; diff --git a/experimental/packages/opentelemetry-instrumentation/src/platform/index.ts b/experimental/packages/opentelemetry-instrumentation/src/platform/index.ts index 7e5d3dc820..1fc5f5e14a 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/platform/index.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/platform/index.ts @@ -15,9 +15,9 @@ */ export { - InstrumentationBase, - InstrumentationModuleDefinition, - InstrumentationModuleFile, - InstrumentationNodeModuleDefinition, - InstrumentationNodeModuleFile + InstrumentationBase, + InstrumentationModuleDefinition, + InstrumentationModuleFile, + InstrumentationNodeModuleDefinition, + InstrumentationNodeModuleFile, } from './node'; diff --git a/experimental/packages/opentelemetry-instrumentation/src/platform/node/index.ts b/experimental/packages/opentelemetry-instrumentation/src/platform/node/index.ts index bc3a8c3fa6..d3df10491f 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/platform/node/index.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/platform/node/index.ts @@ -17,6 +17,6 @@ export { InstrumentationBase } from './instrumentation'; export { InstrumentationNodeModuleDefinition } from './instrumentationNodeModuleDefinition'; export { InstrumentationNodeModuleFile } from './instrumentationNodeModuleFile'; export { - InstrumentationModuleDefinition, - InstrumentationModuleFile + InstrumentationModuleDefinition, + InstrumentationModuleFile, } from './types'; From bf307791194f04fec56e69cefaee1b615f966abf Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Mon, 20 Nov 2023 09:56:53 -0500 Subject: [PATCH 06/10] Do not export node-specific names --- .../src/index.ts | 9 +-- .../src/instrumentation.ts | 17 +++--- .../instrumentationNodeModuleDefinition.ts | 0 .../src/platform/browser/index.ts | 2 +- .../src/platform/index.ts | 8 +-- .../src/platform/node/index.ts | 6 -- .../src/platform/node/instrumentation.ts | 2 +- .../node/instrumentationNodeModuleFile.ts | 2 +- .../src/platform/node/types.ts | 59 ------------------- .../src/types.ts | 44 ++++++++++++++ .../test/node/InstrumentationBase.test.ts | 10 ++-- .../InstrumentationNodeModuleFile.test.ts | 2 +- 12 files changed, 65 insertions(+), 96 deletions(-) rename experimental/packages/opentelemetry-instrumentation/src/{platform/node => }/instrumentationNodeModuleDefinition.ts (100%) delete mode 100644 experimental/packages/opentelemetry-instrumentation/src/platform/node/types.ts diff --git a/experimental/packages/opentelemetry-instrumentation/src/index.ts b/experimental/packages/opentelemetry-instrumentation/src/index.ts index 5f9b47c138..9929671fe5 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/index.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/index.ts @@ -15,13 +15,8 @@ */ export * from './autoLoader'; -export { - InstrumentationBase, - InstrumentationModuleDefinition, - InstrumentationModuleFile, - InstrumentationNodeModuleDefinition, - InstrumentationNodeModuleFile, -} from './platform/index'; +export { InstrumentationBase } from './platform/index'; +export { InstrumentationNodeModuleDefinition } from './instrumentationNodeModuleDefinition'; export * from './types'; export * from './types_internal'; export * from './utils'; diff --git a/experimental/packages/opentelemetry-instrumentation/src/instrumentation.ts b/experimental/packages/opentelemetry-instrumentation/src/instrumentation.ts index 4b729fd439..4552f6dfab 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/instrumentation.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/instrumentation.ts @@ -25,16 +25,19 @@ import { TracerProvider, } from '@opentelemetry/api'; import * as shimmer from 'shimmer'; -import { InstrumentationModuleDefinition } from './platform/node'; -import * as types from './types'; +import { + InstrumentationModuleDefinition, + Instrumentation, + InstrumentationConfig, +} from './types'; /** * Base abstract internal class for instrumenting node and web plugins */ export abstract class InstrumentationAbstract - implements types.Instrumentation + implements Instrumentation { - protected _config: types.InstrumentationConfig; + protected _config: InstrumentationConfig; private _tracer: Tracer; private _meter: Meter; @@ -43,7 +46,7 @@ export abstract class InstrumentationAbstract constructor( public readonly instrumentationName: string, public readonly instrumentationVersion: string, - config: types.InstrumentationConfig = {} + config: InstrumentationConfig = {} ) { this._config = { enabled: true, @@ -95,7 +98,7 @@ export abstract class InstrumentationAbstract } /* Returns InstrumentationConfig */ - public getConfig(): types.InstrumentationConfig { + public getConfig(): InstrumentationConfig { return this._config; } @@ -103,7 +106,7 @@ export abstract class InstrumentationAbstract * Sets InstrumentationConfig to this plugin * @param InstrumentationConfig */ - public setConfig(config: types.InstrumentationConfig = {}): void { + public setConfig(config: InstrumentationConfig = {}): void { this._config = Object.assign({}, config); } diff --git a/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentationNodeModuleDefinition.ts b/experimental/packages/opentelemetry-instrumentation/src/instrumentationNodeModuleDefinition.ts similarity index 100% rename from experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentationNodeModuleDefinition.ts rename to experimental/packages/opentelemetry-instrumentation/src/instrumentationNodeModuleDefinition.ts diff --git a/experimental/packages/opentelemetry-instrumentation/src/platform/browser/index.ts b/experimental/packages/opentelemetry-instrumentation/src/platform/browser/index.ts index 24c76056a1..0b238b42b8 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/platform/browser/index.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/platform/browser/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export * from './instrumentation'; +export { InstrumentationBase } from './instrumentation'; diff --git a/experimental/packages/opentelemetry-instrumentation/src/platform/index.ts b/experimental/packages/opentelemetry-instrumentation/src/platform/index.ts index 1fc5f5e14a..81d3096252 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/platform/index.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/platform/index.ts @@ -14,10 +14,4 @@ * limitations under the License. */ -export { - InstrumentationBase, - InstrumentationModuleDefinition, - InstrumentationModuleFile, - InstrumentationNodeModuleDefinition, - InstrumentationNodeModuleFile, -} from './node'; +export { InstrumentationBase } from './node'; diff --git a/experimental/packages/opentelemetry-instrumentation/src/platform/node/index.ts b/experimental/packages/opentelemetry-instrumentation/src/platform/node/index.ts index d3df10491f..1e81931b2a 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/platform/node/index.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/platform/node/index.ts @@ -14,9 +14,3 @@ * limitations under the License. */ export { InstrumentationBase } from './instrumentation'; -export { InstrumentationNodeModuleDefinition } from './instrumentationNodeModuleDefinition'; -export { InstrumentationNodeModuleFile } from './instrumentationNodeModuleFile'; -export { - InstrumentationModuleDefinition, - InstrumentationModuleFile, -} from './types'; diff --git a/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts b/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts index 03d8f6ba37..a4c11498c9 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts @@ -26,7 +26,7 @@ import { } from './RequireInTheMiddleSingleton'; import type { HookFn } from 'import-in-the-middle'; import * as ImportInTheMiddle from 'import-in-the-middle'; -import { InstrumentationModuleDefinition } from './types'; +import { InstrumentationModuleDefinition } from '../../types'; import { diag } from '@opentelemetry/api'; import type { OnRequireFn } from 'require-in-the-middle'; import { Hook } from 'require-in-the-middle'; diff --git a/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentationNodeModuleFile.ts b/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentationNodeModuleFile.ts index 574f17257e..e5d642e7d4 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentationNodeModuleFile.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentationNodeModuleFile.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { InstrumentationModuleFile } from './types'; +import { InstrumentationModuleFile } from '../../types'; import { normalize } from 'path'; export class InstrumentationNodeModuleFile diff --git a/experimental/packages/opentelemetry-instrumentation/src/platform/node/types.ts b/experimental/packages/opentelemetry-instrumentation/src/platform/node/types.ts deleted file mode 100644 index 5cdfbc84c0..0000000000 --- a/experimental/packages/opentelemetry-instrumentation/src/platform/node/types.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export interface InstrumentationModuleFile { - /** Name of file to be patched with relative path */ - name: string; - - moduleExports?: T; - - /** Supported version this file */ - supportedVersions: string[]; - - /** Method to patch the instrumentation */ - patch(moduleExports: T, moduleVersion?: string): T; - - /** Method to patch the instrumentation */ - - /** Method to unpatch the instrumentation */ - unpatch(moduleExports?: T, moduleVersion?: string): void; -} - -export interface InstrumentationModuleDefinition { - /** Module name or path */ - name: string; - - moduleExports?: T; - - /** Instrumented module version */ - moduleVersion?: string; - - /** Supported version of module */ - supportedVersions: string[]; - - /** Module internal files to be patched */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - files: InstrumentationModuleFile[]; - - /** If set to true, the includePrerelease check will be included when calling semver.satisfies */ - includePrerelease?: boolean; - - /** Method to patch the instrumentation */ - patch?: (moduleExports: T, moduleVersion?: string) => T; - - /** Method to unpatch the instrumentation */ - unpatch?: (moduleExports: T, moduleVersion?: string) => void; -} diff --git a/experimental/packages/opentelemetry-instrumentation/src/types.ts b/experimental/packages/opentelemetry-instrumentation/src/types.ts index 837f096792..760e31165f 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/types.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/types.ts @@ -77,3 +77,47 @@ export interface ShimWrapped extends Function { // eslint-disable-next-line @typescript-eslint/ban-types __original: Function; } + +export interface InstrumentationModuleFile { + /** Name of file to be patched with relative path */ + name: string; + + moduleExports?: T; + + /** Supported version this file */ + supportedVersions: string[]; + + /** Method to patch the instrumentation */ + patch(moduleExports: T, moduleVersion?: string): T; + + /** Method to patch the instrumentation */ + + /** Method to unpatch the instrumentation */ + unpatch(moduleExports?: T, moduleVersion?: string): void; +} + +export interface InstrumentationModuleDefinition { + /** Module name or path */ + name: string; + + moduleExports?: T; + + /** Instrumented module version */ + moduleVersion?: string; + + /** Supported version of module */ + supportedVersions: string[]; + + /** Module internal files to be patched */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + files: InstrumentationModuleFile[]; + + /** If set to true, the includePrerelease check will be included when calling semver.satisfies */ + includePrerelease?: boolean; + + /** Method to patch the instrumentation */ + patch?: (moduleExports: T, moduleVersion?: string) => T; + + /** Method to unpatch the instrumentation */ + unpatch?: (moduleExports: T, moduleVersion?: string) => void; +} diff --git a/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationBase.test.ts b/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationBase.test.ts index b9597c65d8..1219516c39 100644 --- a/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationBase.test.ts +++ b/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationBase.test.ts @@ -17,12 +17,10 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; import * as path from 'path'; -import { - InstrumentationBase, - InstrumentationModuleDefinition, - InstrumentationNodeModuleDefinition, - InstrumentationNodeModuleFile, -} from '../../src'; +import { InstrumentationBase } from '../../src'; +import { InstrumentationNodeModuleDefinition } from '../../src/instrumentationNodeModuleDefinition'; +import { InstrumentationNodeModuleFile } from '../../src/platform/node/instrumentationNodeModuleFile'; +import { InstrumentationModuleDefinition } from '../../src/types'; const MODULE_NAME = 'test-module'; const MODULE_FILE_NAME = 'test-module-file'; diff --git a/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationNodeModuleFile.test.ts b/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationNodeModuleFile.test.ts index 1c7db12a44..214d4fe36a 100644 --- a/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationNodeModuleFile.test.ts +++ b/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationNodeModuleFile.test.ts @@ -16,7 +16,7 @@ import * as assert from 'assert'; import { normalize } from 'path'; -import { InstrumentationNodeModuleFile } from '../../src'; +import { InstrumentationNodeModuleFile } from '../../src/platform/node/instrumentationNodeModuleFile'; describe('InstrumentationNodeModuleFile', () => { it('should convert path', () => { From 4cbb6351f8ef800ead993ec2a1cb7e692f28a869 Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Mon, 20 Nov 2023 10:09:33 -0500 Subject: [PATCH 07/10] Move node module file to root --- .../src/{platform/node => }/instrumentationNodeModuleFile.ts | 2 +- .../test/node/InstrumentationBase.test.ts | 2 +- .../test/node/InstrumentationNodeModuleFile.test.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename experimental/packages/opentelemetry-instrumentation/src/{platform/node => }/instrumentationNodeModuleFile.ts (94%) diff --git a/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentationNodeModuleFile.ts b/experimental/packages/opentelemetry-instrumentation/src/instrumentationNodeModuleFile.ts similarity index 94% rename from experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentationNodeModuleFile.ts rename to experimental/packages/opentelemetry-instrumentation/src/instrumentationNodeModuleFile.ts index e5d642e7d4..574f17257e 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentationNodeModuleFile.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/instrumentationNodeModuleFile.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { InstrumentationModuleFile } from '../../types'; +import { InstrumentationModuleFile } from './types'; import { normalize } from 'path'; export class InstrumentationNodeModuleFile diff --git a/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationBase.test.ts b/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationBase.test.ts index 1219516c39..4027f65753 100644 --- a/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationBase.test.ts +++ b/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationBase.test.ts @@ -19,7 +19,7 @@ import * as sinon from 'sinon'; import * as path from 'path'; import { InstrumentationBase } from '../../src'; import { InstrumentationNodeModuleDefinition } from '../../src/instrumentationNodeModuleDefinition'; -import { InstrumentationNodeModuleFile } from '../../src/platform/node/instrumentationNodeModuleFile'; +import { InstrumentationNodeModuleFile } from '../../src/instrumentationNodeModuleFile'; import { InstrumentationModuleDefinition } from '../../src/types'; const MODULE_NAME = 'test-module'; diff --git a/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationNodeModuleFile.test.ts b/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationNodeModuleFile.test.ts index 214d4fe36a..836f34fecd 100644 --- a/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationNodeModuleFile.test.ts +++ b/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationNodeModuleFile.test.ts @@ -16,7 +16,7 @@ import * as assert from 'assert'; import { normalize } from 'path'; -import { InstrumentationNodeModuleFile } from '../../src/platform/node/instrumentationNodeModuleFile'; +import { InstrumentationNodeModuleFile } from '../../src/instrumentationNodeModuleFile'; describe('InstrumentationNodeModuleFile', () => { it('should convert path', () => { From 21da78f76c55a04c5e6563f5b02a142fba85509f Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Mon, 20 Nov 2023 10:20:07 -0500 Subject: [PATCH 08/10] Export node module file --- .../packages/opentelemetry-instrumentation/src/index.ts | 1 + .../test/node/InstrumentationBase.test.ts | 8 +++++--- .../test/node/InstrumentationNodeModuleFile.test.ts | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/experimental/packages/opentelemetry-instrumentation/src/index.ts b/experimental/packages/opentelemetry-instrumentation/src/index.ts index 9929671fe5..0185bfc79d 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/index.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/index.ts @@ -17,6 +17,7 @@ export * from './autoLoader'; export { InstrumentationBase } from './platform/index'; export { InstrumentationNodeModuleDefinition } from './instrumentationNodeModuleDefinition'; +export { InstrumentationNodeModuleFile } from './instrumentationNodeModuleFile'; export * from './types'; export * from './types_internal'; export * from './utils'; diff --git a/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationBase.test.ts b/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationBase.test.ts index 4027f65753..74d856da00 100644 --- a/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationBase.test.ts +++ b/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationBase.test.ts @@ -18,9 +18,11 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; import * as path from 'path'; import { InstrumentationBase } from '../../src'; -import { InstrumentationNodeModuleDefinition } from '../../src/instrumentationNodeModuleDefinition'; -import { InstrumentationNodeModuleFile } from '../../src/instrumentationNodeModuleFile'; -import { InstrumentationModuleDefinition } from '../../src/types'; +import { + InstrumentationNodeModuleDefinition, + InstrumentationModuleDefinition, + InstrumentationNodeModuleFile, +} from '../../src/'; const MODULE_NAME = 'test-module'; const MODULE_FILE_NAME = 'test-module-file'; diff --git a/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationNodeModuleFile.test.ts b/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationNodeModuleFile.test.ts index 836f34fecd..1c7db12a44 100644 --- a/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationNodeModuleFile.test.ts +++ b/experimental/packages/opentelemetry-instrumentation/test/node/InstrumentationNodeModuleFile.test.ts @@ -16,7 +16,7 @@ import * as assert from 'assert'; import { normalize } from 'path'; -import { InstrumentationNodeModuleFile } from '../../src/instrumentationNodeModuleFile'; +import { InstrumentationNodeModuleFile } from '../../src'; describe('InstrumentationNodeModuleFile', () => { it('should convert path', () => { From dc10b81ee99c12789eed4ca5b6a9646fe70e96c6 Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Tue, 21 Nov 2023 12:39:58 -0500 Subject: [PATCH 09/10] Bump to 18 on other workflows --- .github/workflows/lint.yml | 2 +- .github/workflows/unit-test.yml | 4 ++-- .github/workflows/w3c-integration-test.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index eac7627c9b..30beff6f5d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/setup-node@v4 with: - node-version: '16' + node-version: 18 - uses: actions/checkout@v4 diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 0e57c355ce..aba88acef3 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -77,7 +77,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Bootstrap run: npm ci @@ -98,7 +98,7 @@ jobs: uses: actions/checkout@v4.0.0 - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Bootstrap run: npm ci diff --git a/.github/workflows/w3c-integration-test.yml b/.github/workflows/w3c-integration-test.yml index 1df205b05d..51614cf87b 100644 --- a/.github/workflows/w3c-integration-test.yml +++ b/.github/workflows/w3c-integration-test.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: '16' + node-version: 18 - name: Install and Bootstrap 🔧 run: npm ci From 543f0b470c2b7dc87b38cd4c3948aa3cfb61c41b Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Wed, 22 Nov 2023 08:08:57 -0500 Subject: [PATCH 10/10] Benchmark a tested version --- .github/workflows/benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 1f9376d610..1ee74306e9 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: node_version: - - "20" + - 18 runs-on: self-hosted timeout-minutes: 10 env: