diff --git a/.github/component-label-map.yml b/.github/component-label-map.yml index 5ab8934eee..ae5125613e 100644 --- a/.github/component-label-map.yml +++ b/.github/component-label-map.yml @@ -278,6 +278,7 @@ pkg-status:unmaintained: - changed-files: - any-glob-to-any-file: - detectors/node/opentelemetry-resource-detector-github/** + - packages/opentelemetry-redis-common/** - plugins/node/instrumentation-fs/** - plugins/node/instrumentation-tedious/** - plugins/node/opentelemetry-instrumentation-connect/** @@ -288,6 +289,9 @@ pkg-status:unmaintained: - plugins/node/opentelemetry-instrumentation-knex/** - plugins/node/opentelemetry-instrumentation-koa/** - plugins/node/opentelemetry-instrumentation-memcached/** + - plugins/node/opentelemetry-instrumentation-mongodb/** + - plugins/node/opentelemetry-instrumentation-mysql/** + - plugins/node/opentelemetry-instrumentation-mysql2/** - plugins/node/opentelemetry-instrumentation-nestjs-core/** - plugins/node/opentelemetry-instrumentation-restify/** - plugins/node/opentelemetry-instrumentation-router/** diff --git a/.github/component_owners.yml b/.github/component_owners.yml index a6b5109ff9..9102833c14 100644 --- a/.github/component_owners.yml +++ b/.github/component_owners.yml @@ -42,8 +42,8 @@ components: - pichlermarc - legendecas - blumamir - packages/opentelemetry-redis-common: - - haddasbronfman + packages/opentelemetry-redis-common: [] + # Unmaintained packages/opentelemetry-test-utils: - dyladan - pichlermarc @@ -102,12 +102,12 @@ components: # Unmaintained plugins/node/opentelemetry-instrumentation-memcached: [] # Unmaintained - plugins/node/opentelemetry-instrumentation-mongodb: - - osherv - plugins/node/opentelemetry-instrumentation-mysql: - - haddasbronfman - plugins/node/opentelemetry-instrumentation-mysql2: - - haddasbronfman + plugins/node/opentelemetry-instrumentation-mongodb: [] + # Unmaintained + plugins/node/opentelemetry-instrumentation-mysql: [] + # Unmaintained + plugins/node/opentelemetry-instrumentation-mysql2: [] + # Unmaintained plugins/node/opentelemetry-instrumentation-nestjs-core: [] # Unmaintained plugins/node/opentelemetry-instrumentation-net: diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index a60b6e246d..390ceabfb5 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -139,6 +139,8 @@ jobs: - name: Report Coverage if: ${{ matrix.code-coverage && !cancelled()}} uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: verbose: true @@ -170,5 +172,7 @@ jobs: run: npm run test:browser - name: Report Coverage uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: verbose: true diff --git a/plugins/node/instrumentation-undici/src/internal-types.ts b/plugins/node/instrumentation-undici/src/internal-types.ts index 67c7fd6ce3..e6b2fff535 100644 --- a/plugins/node/instrumentation-undici/src/internal-types.ts +++ b/plugins/node/instrumentation-undici/src/internal-types.ts @@ -13,14 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import type { Channel } from 'diagnostics_channel'; import { UndiciRequest, UndiciResponse } from './types'; export interface ListenerRecord { name: string; - channel: Channel; - onMessage: (message: any, name: string | symbol) => void; + unsubscribe: () => void; } export interface RequestMessage { diff --git a/plugins/node/instrumentation-undici/src/undici.ts b/plugins/node/instrumentation-undici/src/undici.ts index 0d8ebedc73..1755b7417b 100644 --- a/plugins/node/instrumentation-undici/src/undici.ts +++ b/plugins/node/instrumentation-undici/src/undici.ts @@ -77,7 +77,7 @@ export class UndiciInstrumentation extends InstrumentationBase sub.channel.unsubscribe(sub.onMessage)); + this._channelSubs.forEach(sub => sub.unsubscribe()); this._channelSubs.length = 0; } @@ -137,14 +137,29 @@ export class UndiciInstrumentation extends InstrumentationBase void ) { - const channel = diagch.channel(diagnosticChannel); - channel.subscribe(onMessage); + // `diagnostics_channel` had a ref counting bug until v18.19.0. + // https://github.com/nodejs/node/pull/47520 + const [major, minor] = process.version + .replace('v', '') + .split('.') + .map(n => Number(n)); + const useNewSubscribe = major > 18 || (major === 18 && minor >= 19); + + let unsubscribe: () => void; + if (useNewSubscribe) { + diagch.subscribe?.(diagnosticChannel, onMessage); + unsubscribe = () => diagch.unsubscribe?.(diagnosticChannel, onMessage); + } else { + const channel = diagch.channel(diagnosticChannel); + channel.subscribe(onMessage); + unsubscribe = () => channel.unsubscribe(onMessage); + } + this._channelSubs.push({ name: diagnosticChannel, - channel, - onMessage, + unsubscribe, }); }