From 1486639354df7d1249075691df04fdd971d24019 Mon Sep 17 00:00:00 2001 From: Mayur Kale Date: Wed, 24 Jul 2019 20:09:36 -0700 Subject: [PATCH] Change DEFAULT_PLUGIN_PACKAGE_NAME_PREFIX to plugin --- .../src/instrumentation/constants.ts | 2 +- .../@opentelemetry/instrumentation-simple-module/package.json | 4 ---- .../index.js | 0 .../@opentelemetry/plugin-simple-module/package.json | 4 ++++ .../simple-module.js | 4 ++-- .../test/instrumentation/utils.test.ts | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/instrumentation-simple-module/package.json rename packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/{instrumentation-simple-module => plugin-simple-module}/index.js (100%) create mode 100644 packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/plugin-simple-module/package.json rename packages/opentelemetry-node-tracer/test/instrumentation/node_modules/@opentelemetry/{instrumentation-simple-module => plugin-simple-module}/simple-module.js (94%) 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' ); }); });