From 84567f5fa714df50eff226f47daeb34ac992fb96 Mon Sep 17 00:00:00 2001 From: Mayur Kale Date: Sun, 15 Sep 2019 16:56:32 -0700 Subject: [PATCH] chore: code cleanup (#256) * chore: code cleanup * fix: build --- .../src/instrumentation/constants.ts | 21 ------------------- .../src/instrumentation/utils.ts | 11 ---------- .../test/instrumentation/utils.test.ts | 13 ------------ 3 files changed, 45 deletions(-) delete mode 100644 packages/opentelemetry-node-tracer/src/instrumentation/constants.ts diff --git a/packages/opentelemetry-node-tracer/src/instrumentation/constants.ts b/packages/opentelemetry-node-tracer/src/instrumentation/constants.ts deleted file mode 100644 index c75544c649..0000000000 --- a/packages/opentelemetry-node-tracer/src/instrumentation/constants.ts +++ /dev/null @@ -1,21 +0,0 @@ -/*! - * Copyright 2019, OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** opentelemetry scope */ -export const OPENTELEMETRY_SCOPE = '@opentelemetry'; - -/** Default prefix for instrumentation modules */ -export const DEFAULT_PLUGIN_PACKAGE_NAME_PREFIX = 'plugin'; diff --git a/packages/opentelemetry-node-tracer/src/instrumentation/utils.ts b/packages/opentelemetry-node-tracer/src/instrumentation/utils.ts index 1e3238624c..406a397735 100644 --- a/packages/opentelemetry-node-tracer/src/instrumentation/utils.ts +++ b/packages/opentelemetry-node-tracer/src/instrumentation/utils.ts @@ -17,17 +17,6 @@ import { Logger } from '@opentelemetry/types'; import * as path from 'path'; import * as semver from 'semver'; -import * as constants from './constants'; - -/** - * Gets the default package name for a target module. The default package - * name uses the default scope and a default prefix. - * @param moduleName The module name. - * @returns The default name for the package. - */ -export function defaultPackageName(moduleName: string): string { - return `${constants.OPENTELEMETRY_SCOPE}/${constants.DEFAULT_PLUGIN_PACKAGE_NAME_PREFIX}-${moduleName}`; -} /** * Gets the package version. diff --git a/packages/opentelemetry-node-tracer/test/instrumentation/utils.test.ts b/packages/opentelemetry-node-tracer/test/instrumentation/utils.test.ts index 8adfcd4075..0d9a634f71 100644 --- a/packages/opentelemetry-node-tracer/test/instrumentation/utils.test.ts +++ b/packages/opentelemetry-node-tracer/test/instrumentation/utils.test.ts @@ -42,19 +42,6 @@ describe('Instrumentation#utils', () => { utils.searchPathForTest(INSTALLED_PLUGINS_PATH); }); - describe('defaultPackageName', () => { - it('should return package name with default scope and a prefix', () => { - assert.strictEqual( - utils.defaultPackageName('http'), - '@opentelemetry/plugin-http' - ); - assert.strictEqual( - utils.defaultPackageName('simple-module'), - '@opentelemetry/plugin-simple-module' - ); - }); - }); - describe('getPackageVersion', () => { it('should handle when undefined basedir', () => { assert.strictEqual(utils.getPackageVersion(logger), null);