diff --git a/packages/opentelemetry-node-tracer/src/instrumentation/constants.ts b/packages/opentelemetry-node-tracer/src/instrumentation/constants.ts index f0d32a01c0b..622bd3ddeb7 100644 --- a/packages/opentelemetry-node-tracer/src/instrumentation/constants.ts +++ b/packages/opentelemetry-node-tracer/src/instrumentation/constants.ts @@ -19,5 +19,5 @@ export const constants = { /** opentelemetry scope */ OPENTELEMETRY_SCOPE: '@opentelemetry', /** Default prefix for instrumentation modules */ - DEFAULT_PLUGIN_PACKAGE_NAME_PREFIX: 'instrumentation', + DEFAULT_PLUGIN_PACKAGE_NAME_PREFIX: 'plugin', }; diff --git a/packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/instrumentation-simple-module/package.json b/packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/instrumentation-simple-module/package.json deleted file mode 100644 index 78a6884ed64..00000000000 --- a/packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/instrumentation-simple-module/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "@opentelemetry/instrumentation-simple-module", - "version": "0.0.1" -} diff --git a/packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/instrumentation-simple-module/index.js b/packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/plugin-simple-module/index.js similarity index 100% rename from packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/instrumentation-simple-module/index.js rename to packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/plugin-simple-module/index.js diff --git a/packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/plugin-simple-module/package.json b/packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/plugin-simple-module/package.json new file mode 100644 index 00000000000..59d87df3500 --- /dev/null +++ b/packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/plugin-simple-module/package.json @@ -0,0 +1,4 @@ +{ + "name": "@opentelemetry/plugin-simple-module", + "version": "0.0.1" +} diff --git a/packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/instrumentation-simple-module/simple-module.js b/packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/plugin-simple-module/simple-module.js similarity index 94% rename from packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/instrumentation-simple-module/simple-module.js rename to packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/plugin-simple-module/simple-module.js index 7c216fb4ea6..25d13a0c24b 100644 --- a/packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/instrumentation-simple-module/simple-module.js +++ b/packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/plugin-simple-module/simple-module.js @@ -7,13 +7,13 @@ class SimpleModulePlugin extends core_1.BasePlugin { super(); } - applyPatch() { + patch() { shimmer.wrap(this.moduleExports, 'name', orig => () => 'patched-' + orig.apply()); shimmer.wrap(this.moduleExports, 'value', orig => () => orig.apply() + 1); return this.moduleExports; } - applyUnpatch() { + unpatch() { shimmer.unwrap(this.moduleExports, 'name'); shimmer.unwrap(this.moduleExports, 'value'); } diff --git a/packages/opentelemetry-node-tracer/test/instrumentation/utils.test.ts b/packages/opentelemetry-node-tracer/test/instrumentation/utils.test.ts index 5f2bda1b0de..66d25390c59 100644 --- a/packages/opentelemetry-node-tracer/test/instrumentation/utils.test.ts +++ b/packages/opentelemetry-node-tracer/test/instrumentation/utils.test.ts @@ -46,11 +46,11 @@ describe('Instrumentation#utils', () => { it('should return package name with default scope and a prefix', () => { assert.strictEqual( utils.defaultPackageName('http'), - '@opentelemetry/instrumentation-http' + '@opentelemetry/plugin-http' ); assert.strictEqual( utils.defaultPackageName('simple-module'), - '@opentelemetry/instrumentation-simple-module' + '@opentelemetry/plugin-simple-module' ); }); });