From e93a192b672c8db361bac83ad60294ca49b95361 Mon Sep 17 00:00:00 2001 From: Amir Blum Date: Sun, 19 Feb 2023 09:07:03 +0200 Subject: [PATCH] fix: remove component attribute from instrumentations (#1399) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gerhard Stöbich --- .../src/enums/AttributeNames.ts | 1 - .../src/instrumentation.ts | 7 +------ .../src/internal-types.ts | 2 -- .../src/enums/AttributeNames.ts | 1 - .../src/instrumentation.ts | 1 - .../src/instrumentation.ts | 3 --- 6 files changed, 1 insertion(+), 14 deletions(-) diff --git a/plugins/node/opentelemetry-instrumentation-graphql/src/enums/AttributeNames.ts b/plugins/node/opentelemetry-instrumentation-graphql/src/enums/AttributeNames.ts index d264930721a..79032ab55db 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/src/enums/AttributeNames.ts +++ b/plugins/node/opentelemetry-instrumentation-graphql/src/enums/AttributeNames.ts @@ -14,7 +14,6 @@ * limitations under the License. */ export enum AttributeNames { - COMPONENT = 'graphql', SOURCE = 'graphql.source', FIELD_NAME = 'graphql.field.name', FIELD_PATH = 'graphql.field.path', diff --git a/plugins/node/opentelemetry-instrumentation-koa/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-koa/src/instrumentation.ts index 4f852bc89f6..f270875efac 100644 --- a/plugins/node/opentelemetry-instrumentation-koa/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-koa/src/instrumentation.ts @@ -33,15 +33,10 @@ import { AttributeNames } from './enums/AttributeNames'; import { VERSION } from './version'; import { getMiddlewareMetadata, isLayerIgnored } from './utils'; import { getRPCMetadata, RPCType, setRPCMetadata } from '@opentelemetry/core'; -import { - kLayerPatched, - KoaComponentName, - KoaPatchedMiddleware, -} from './internal-types'; +import { kLayerPatched, KoaPatchedMiddleware } from './internal-types'; /** Koa instrumentation for OpenTelemetry */ export class KoaInstrumentation extends InstrumentationBase { - static readonly component = KoaComponentName; constructor(config: KoaInstrumentationConfig = {}) { super( '@opentelemetry/instrumentation-koa', diff --git a/plugins/node/opentelemetry-instrumentation-koa/src/internal-types.ts b/plugins/node/opentelemetry-instrumentation-koa/src/internal-types.ts index d228b0f4fcf..05557e938a3 100644 --- a/plugins/node/opentelemetry-instrumentation-koa/src/internal-types.ts +++ b/plugins/node/opentelemetry-instrumentation-koa/src/internal-types.ts @@ -24,5 +24,3 @@ export const kLayerPatched: unique symbol = Symbol('koa-layer-patched'); export type KoaPatchedMiddleware = KoaMiddleware & { [kLayerPatched]?: boolean; }; - -export const KoaComponentName = 'koa'; diff --git a/plugins/web/opentelemetry-instrumentation-document-load/src/enums/AttributeNames.ts b/plugins/web/opentelemetry-instrumentation-document-load/src/enums/AttributeNames.ts index ad672fd016c..0a351254b3b 100644 --- a/plugins/web/opentelemetry-instrumentation-document-load/src/enums/AttributeNames.ts +++ b/plugins/web/opentelemetry-instrumentation-document-load/src/enums/AttributeNames.ts @@ -15,7 +15,6 @@ */ export enum AttributeNames { - COMPONENT = 'component', DOCUMENT_LOAD = 'documentLoad', DOCUMENT_FETCH = 'documentFetch', RESOURCE_FETCH = 'resourceFetch', diff --git a/plugins/web/opentelemetry-instrumentation-document-load/src/instrumentation.ts b/plugins/web/opentelemetry-instrumentation-document-load/src/instrumentation.ts index cd0fdccb84d..49b3bb6b01a 100644 --- a/plugins/web/opentelemetry-instrumentation-document-load/src/instrumentation.ts +++ b/plugins/web/opentelemetry-instrumentation-document-load/src/instrumentation.ts @@ -214,7 +214,6 @@ export class DocumentLoadInstrumentation extends InstrumentationBase { }, parentSpan ? trace.setSpan(context.active(), parentSpan) : undefined ); - span.setAttribute(AttributeNames.COMPONENT, this.component); return span; } return undefined; diff --git a/plugins/web/opentelemetry-instrumentation-long-task/src/instrumentation.ts b/plugins/web/opentelemetry-instrumentation-long-task/src/instrumentation.ts index d39122d745a..7b17907a89b 100644 --- a/plugins/web/opentelemetry-instrumentation-long-task/src/instrumentation.ts +++ b/plugins/web/opentelemetry-instrumentation-long-task/src/instrumentation.ts @@ -25,9 +25,7 @@ import type { const LONGTASK_PERFORMANCE_TYPE = 'longtask'; export class LongTaskInstrumentation extends InstrumentationBase { - readonly component: string = 'long-task'; readonly version: string = VERSION; - moduleName = this.component; private _observer?: PerformanceObserver; override _config!: LongtaskInstrumentationConfig; @@ -66,7 +64,6 @@ export class LongTaskInstrumentation extends InstrumentationBase { diag.error('longtask instrumentation: observer callback failed', err); } } - span.setAttribute('component', this.component); span.setAttribute('longtask.name', entry.name); span.setAttribute('longtask.entry_type', entry.entryType); span.setAttribute('longtask.duration', entry.duration);