From 6c29fb4b95d26d79894a22469adf343afa91baa3 Mon Sep 17 00:00:00 2001 From: Ankcorn Date: Thu, 28 Sep 2023 18:57:00 +0100 Subject: [PATCH] fix(bug): handle wildcards like semver --- .../src/platform/node/instrumentation.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts b/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts index 568b2764c4..2c4ca137f3 100644 --- a/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts +++ b/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts @@ -36,8 +36,7 @@ import { Hook } from 'require-in-the-middle'; */ export abstract class InstrumentationBase extends InstrumentationAbstract - implements types.Instrumentation -{ + implements types.Instrumentation { private _modules: InstrumentationModuleDefinition[]; private _hooks: (Hooked | Hook)[] = []; private _requireInTheMiddleSingleton: RequireInTheMiddleSingleton = @@ -62,8 +61,8 @@ export abstract class InstrumentationBase if (this._modules.length === 0) { diag.debug( 'No modules instrumentation has been defined for ' + - `'${this.instrumentationName}@${this.instrumentationVersion}'` + - ', nothing will be patched' + `'${this.instrumentationName}@${this.instrumentationVersion}'` + + ', nothing will be patched' ); } @@ -309,6 +308,6 @@ function isSupported( } return supportedVersions.some(supportedVersion => { - return satisfies(version, supportedVersion); + return supportedVersion === '*' || satisfies(version, supportedVersion); }); }