From a5187a076640b5a56bea321f5ee0df431e99fb7c Mon Sep 17 00:00:00 2001 From: vmarchaud Date: Tue, 2 Mar 2021 14:21:09 +0100 Subject: [PATCH] chore: use external const for supported versions --- .../opentelemetry-instrumentation-mongodb/src/mongodb.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/src/mongodb.ts b/plugins/node/opentelemetry-instrumentation-mongodb/src/mongodb.ts index 93a8c46323..c72a406442 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/src/mongodb.ts +++ b/plugins/node/opentelemetry-instrumentation-mongodb/src/mongodb.ts @@ -43,11 +43,12 @@ import { isWrapped, } from '@opentelemetry/instrumentation'; +const supportedVersions = ['>=3.3 <4']; + /** mongodb instrumentation plugin for OpenTelemetry */ export class MongoDBInstrumentation extends InstrumentationBase< typeof mongodb > { - private _supportedVersions = ['>=3.3 <4'] constructor(protected _config: MongoDbInstrumentationConfig = {}) { super('@opentelemetry/instrumentation-mongodb', VERSION, _config); } @@ -57,13 +58,13 @@ export class MongoDBInstrumentation extends InstrumentationBase< return [ new InstrumentationNodeModuleDefinition( 'mongodb', - this._supportedVersions, + supportedVersions, undefined, undefined, [ new InstrumentationNodeModuleFile( 'mongodb/lib/core/wireprotocol/index.js', - this._supportedVersions, + supportedVersions, patch, unpatch ),