diff --git a/packages/node/package.json b/packages/node/package.json index 6914dbb75ab0..694f9882b3c2 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -69,7 +69,7 @@ "@opentelemetry/core": "^2.6.1", "@opentelemetry/instrumentation": "^0.214.0", "@opentelemetry/sdk-trace-base": "^2.6.1", - "@opentelemetry/semantic-conventions": "^1.40.0", + "@sentry/conventions": "^0.12.0", "@sentry/core": "10.58.0", "@sentry/node-core": "10.58.0", "@sentry/opentelemetry": "10.58.0", diff --git a/packages/node/src/integrations/node-fetch/vendored/semconv.ts b/packages/node/src/integrations/node-fetch/vendored/semconv.ts new file mode 100644 index 000000000000..0a98bc1491bb --- /dev/null +++ b/packages/node/src/integrations/node-fetch/vendored/semconv.ts @@ -0,0 +1,9 @@ +/** + * Original HTTP method sent by the client in the request line. + */ +export const ATTR_HTTP_REQUEST_METHOD_ORIGINAL = 'http.request.method_original' as const; + +/** + * Duration of HTTP client requests. + */ +export const METRIC_HTTP_CLIENT_REQUEST_DURATION = 'http.client.request.duration' as const; diff --git a/packages/node/src/integrations/node-fetch/vendored/undici.ts b/packages/node/src/integrations/node-fetch/vendored/undici.ts index 0ab187ab4007..8a5c7d2a5f63 100644 --- a/packages/node/src/integrations/node-fetch/vendored/undici.ts +++ b/packages/node/src/integrations/node-fetch/vendored/undici.ts @@ -24,22 +24,21 @@ import { trace, ValueType, } from '@opentelemetry/api'; +import { ATTR_HTTP_REQUEST_METHOD_ORIGINAL, METRIC_HTTP_CLIENT_REQUEST_DURATION } from './semconv'; import { - ATTR_ERROR_TYPE, - ATTR_HTTP_REQUEST_METHOD, - ATTR_HTTP_REQUEST_METHOD_ORIGINAL, - ATTR_HTTP_RESPONSE_STATUS_CODE, - ATTR_NETWORK_PEER_ADDRESS, - ATTR_NETWORK_PEER_PORT, - ATTR_SERVER_ADDRESS, - ATTR_SERVER_PORT, - ATTR_URL_FULL, - ATTR_URL_PATH, - ATTR_URL_QUERY, - ATTR_URL_SCHEME, - ATTR_USER_AGENT_ORIGINAL, - METRIC_HTTP_CLIENT_REQUEST_DURATION, -} from '@opentelemetry/semantic-conventions'; + ERROR_TYPE, + HTTP_REQUEST_METHOD, + HTTP_RESPONSE_STATUS_CODE, + NETWORK_PEER_ADDRESS, + NETWORK_PEER_PORT, + SERVER_ADDRESS, + SERVER_PORT, + URL_FULL, + URL_PATH, + URL_QUERY, + URL_SCHEME, + USER_AGENT_ORIGINAL, +} from '@sentry/conventions/attributes'; import type { ListenerRecord, @@ -225,21 +224,21 @@ export class UndiciInstrumentation extends InstrumentationBase = { https: '443', http: '80' }; const serverAddress = requestUrl.hostname; const serverPort = requestUrl.port || schemePorts[urlScheme]; - attributes[ATTR_SERVER_ADDRESS] = serverAddress; + attributes[SERVER_ADDRESS] = serverAddress; if (serverPort && !isNaN(Number(serverPort))) { - attributes[ATTR_SERVER_PORT] = Number(serverPort); + attributes[SERVER_PORT] = Number(serverPort); } // Get user agent from headers @@ -251,7 +250,7 @@ export class UndiciInstrumentation extends InstrumentationBase { if (key in attributes) { diff --git a/packages/node/src/integrations/tracing/amqplib/vendored/semconv-obsolete.ts b/packages/node/src/integrations/tracing/amqplib/vendored/semconv-obsolete.ts index 9c9a10e68456..b23798e075bd 100644 --- a/packages/node/src/integrations/tracing/amqplib/vendored/semconv-obsolete.ts +++ b/packages/node/src/integrations/tracing/amqplib/vendored/semconv-obsolete.ts @@ -8,15 +8,6 @@ */ /* eslint-disable */ -/* - * This file contains constants for values that where replaced/removed from - * Semantic Conventions long enough ago that they do not have `ATTR_*` - * constants in the `@opentelemetry/semantic-conventions` package. Eventually - * it is expected that this instrumention will be updated to emit telemetry - * using modern Semantic Conventions, dropping the need for the constants in - * this file. - */ - /** * The message destination name. This might be equal to the span name but is required nevertheless. * diff --git a/packages/node/src/integrations/tracing/amqplib/vendored/semconv.ts b/packages/node/src/integrations/tracing/amqplib/vendored/semconv.ts index e72194c62ad3..321d0dec7e82 100644 --- a/packages/node/src/integrations/tracing/amqplib/vendored/semconv.ts +++ b/packages/node/src/integrations/tracing/amqplib/vendored/semconv.ts @@ -21,28 +21,15 @@ * @example create * @example process * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * * @deprecated Replaced by `messaging.operation.type`. */ export const ATTR_MESSAGING_OPERATION = 'messaging.operation' as const; -/** - * The messaging system as identified by the client instrumentation. - * - * @note The actual messaging system may differ from the one known by the client. For example, when using Kafka client libraries to communicate with Azure Event Hubs, the `messaging.system` is set to `kafka` based on the instrumentation's best knowledge. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -export const ATTR_MESSAGING_SYSTEM = 'messaging.system' as const; - /** * Deprecated, use `server.address` on client spans and `client.address` on server spans. * * @example example.com * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * * @deprecated Replaced by `server.address` on client spans and `client.address` on server spans. */ export const ATTR_NET_PEER_NAME = 'net.peer.name' as const; @@ -52,8 +39,6 @@ export const ATTR_NET_PEER_NAME = 'net.peer.name' as const; * * @example 8080 * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * * @deprecated Replaced by `server.port` on client spans and `client.port` on server spans. */ export const ATTR_NET_PEER_PORT = 'net.peer.port' as const; diff --git a/packages/node/src/integrations/tracing/amqplib/vendored/utils.ts b/packages/node/src/integrations/tracing/amqplib/vendored/utils.ts index 8817b5750382..6a8f41e7ef4c 100644 --- a/packages/node/src/integrations/tracing/amqplib/vendored/utils.ts +++ b/packages/node/src/integrations/tracing/amqplib/vendored/utils.ts @@ -11,8 +11,8 @@ import { Context, createContextKey, diag, Span, Attributes, AttributeValue } from '@opentelemetry/api'; import { SemconvStability } from '@opentelemetry/instrumentation'; -import { ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT } from '@opentelemetry/semantic-conventions'; -import { ATTR_MESSAGING_SYSTEM, ATTR_NET_PEER_NAME, ATTR_NET_PEER_PORT } from './semconv'; +import { MESSAGING_SYSTEM, SERVER_ADDRESS, SERVER_PORT } from '@sentry/conventions/attributes'; +import { ATTR_NET_PEER_NAME, ATTR_NET_PEER_PORT } from './semconv'; import { ATTR_MESSAGING_PROTOCOL, ATTR_MESSAGING_PROTOCOL_VERSION, ATTR_MESSAGING_URL } from './semconv-obsolete'; import type { Connection, Channel, ConfirmChannel, Options } from './amqplib-types'; import type { ConsumeMessage, Message } from './types'; @@ -95,7 +95,7 @@ export const getConnectionAttributesFromServer = (conn: Connection): Attributes const product = conn.serverProperties.product?.toLowerCase?.(); if (product) { return { - [ATTR_MESSAGING_SYSTEM]: product, + [MESSAGING_SYSTEM]: product, }; } else { return {}; @@ -127,7 +127,7 @@ export const getConnectionAttributesFromUrl = ( } if (netSemconvStability & SemconvStability.STABLE) { Object.assign(attributes, { - ...extractConnectionAttributeOrLog(url, ATTR_SERVER_ADDRESS, hostname, 'hostname'), + ...extractConnectionAttributeOrLog(url, SERVER_ADDRESS, hostname, 'hostname'), }); } @@ -136,7 +136,7 @@ export const getConnectionAttributesFromUrl = ( Object.assign(attributes, extractConnectionAttributeOrLog(url, ATTR_NET_PEER_PORT, port, 'port')); } if (netSemconvStability & SemconvStability.STABLE) { - Object.assign(attributes, extractConnectionAttributeOrLog(url, ATTR_SERVER_PORT, port, 'port')); + Object.assign(attributes, extractConnectionAttributeOrLog(url, SERVER_PORT, port, 'port')); } } else { const censoredUrl = censorPassword(url); @@ -157,7 +157,7 @@ export const getConnectionAttributesFromUrl = ( } if (netSemconvStability & SemconvStability.STABLE) { Object.assign(attributes, { - ...extractConnectionAttributeOrLog(censoredUrl, ATTR_SERVER_ADDRESS, hostname, 'hostname'), + ...extractConnectionAttributeOrLog(censoredUrl, SERVER_ADDRESS, hostname, 'hostname'), }); } @@ -166,7 +166,7 @@ export const getConnectionAttributesFromUrl = ( Object.assign(attributes, extractConnectionAttributeOrLog(censoredUrl, ATTR_NET_PEER_PORT, port, 'port')); } if (netSemconvStability & SemconvStability.STABLE) { - Object.assign(attributes, extractConnectionAttributeOrLog(censoredUrl, ATTR_SERVER_PORT, port, 'port')); + Object.assign(attributes, extractConnectionAttributeOrLog(censoredUrl, SERVER_PORT, port, 'port')); } } catch (err) { diag.error('amqplib instrumentation: error while extracting connection details from connection url', { diff --git a/packages/node/src/integrations/tracing/connect/vendored/instrumentation.ts b/packages/node/src/integrations/tracing/connect/vendored/instrumentation.ts index 6d1255a02708..8328c03ebac8 100644 --- a/packages/node/src/integrations/tracing/connect/vendored/instrumentation.ts +++ b/packages/node/src/integrations/tracing/connect/vendored/instrumentation.ts @@ -22,7 +22,7 @@ import { import { setHttpServerSpanRouteAttribute } from '../../../../utils/setHttpServerSpanRouteAttribute'; import type { InstrumentationConfig } from '@opentelemetry/instrumentation'; import { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation'; -import { ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions'; +import { HTTP_ROUTE } from '@sentry/conventions/attributes'; import { replaceCurrentStackRoute, addNewStackLayer, generateRoute } from './utils'; const PACKAGE_NAME = '@sentry/instrumentation-connect'; @@ -82,7 +82,7 @@ export class ConnectInstrumentation extends InstrumentationBase { op: `${connectType}.connect`, attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.connect', - [ATTR_HTTP_ROUTE]: routeName.length > 0 ? routeName : '/', + [HTTP_ROUTE]: routeName.length > 0 ? routeName : '/', [AttributeNames.CONNECT_TYPE]: connectType, [AttributeNames.CONNECT_NAME]: connectName, }, diff --git a/packages/node/src/integrations/tracing/fastify/v3/instrumentation.ts b/packages/node/src/integrations/tracing/fastify/v3/instrumentation.ts index 5ca80f140935..cfc662a39f15 100644 --- a/packages/node/src/integrations/tracing/fastify/v3/instrumentation.ts +++ b/packages/node/src/integrations/tracing/fastify/v3/instrumentation.ts @@ -27,7 +27,7 @@ import { InstrumentationNodeModuleDefinition, safeExecuteInTheMiddle, } from '@opentelemetry/instrumentation'; -import { SEMATTRS_HTTP_ROUTE } from '@opentelemetry/semantic-conventions'; +import { HTTP_ROUTE } from '@sentry/conventions/attributes'; import type { Span } from '@sentry/core'; import { getClient, @@ -265,8 +265,7 @@ export class FastifyInstrumentationV3 extends InstrumentationBase ${hook}`, [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.ROUTE, - [ATTR_HTTP_ROUTE]: routeOptions.url, + [HTTP_ROUTE]: routeOptions.url, [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]: handlerLike.name?.length > 0 ? handlerLike.name : ANONYMOUS_FUNCTION_NAME, }); @@ -185,7 +180,7 @@ export class FastifyOtelInstrumentation extends InstrumentationBase ${hook}`, [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.ROUTE, - [ATTR_HTTP_ROUTE]: routeOptions.url, + [HTTP_ROUTE]: routeOptions.url, [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]: handler.name?.length > 0 ? handler.name : ANONYMOUS_FUNCTION_NAME, }), @@ -216,7 +211,7 @@ export class FastifyOtelInstrumentation extends InstrumentationBase 0 ? routeOptions.handler.name : ANONYMOUS_FUNCTION_NAME, }); @@ -241,12 +236,12 @@ export class FastifyOtelInstrumentation extends InstrumentationBase = { [ATTRIBUTE_NAMES.ROOT]: PACKAGE_NAME, - [ATTR_HTTP_REQUEST_METHOD]: request.method, - [ATTR_URL_PATH]: request.url, + [HTTP_REQUEST_METHOD]: request.method, + [URL_PATH]: request.url, }; if (request.routeOptions.url != null) { - attributes[ATTR_HTTP_ROUTE] = request.routeOptions.url; + attributes[HTTP_ROUTE] = request.routeOptions.url; } const span = this[kInstrumentation].tracer.startSpan('request', { attributes }, ctx); @@ -271,7 +266,7 @@ export class FastifyOtelInstrumentation extends InstrumentationBase( ): Span { const span = tracer.startSpan(`${spanName} ${reference.path}`, { kind: SpanKind.CLIENT }); addAttributes(span, reference); - span.setAttribute(ATTR_DB_OPERATION_NAME, spanName); + span.setAttribute(DB_OPERATION_NAME, spanName); return span; } @@ -313,9 +313,9 @@ function addAttributes( const settings: FirestoreSettings = json.settings || {}; const attributes: SpanAttributes = { - [ATTR_DB_COLLECTION_NAME]: reference.path, - [ATTR_DB_NAMESPACE]: firestoreApp.name, - [ATTR_DB_SYSTEM_NAME]: 'firebase.firestore', + [DB_COLLECTION_NAME]: reference.path, + [DB_NAMESPACE]: firestoreApp.name, + [DB_SYSTEM_NAME]: 'firebase.firestore', 'firebase.firestore.type': reference.type, 'firebase.firestore.options.projectId': firestoreOptions.projectId, 'firebase.firestore.options.appId': firestoreOptions.appId, @@ -326,10 +326,10 @@ function addAttributes( const { address, port } = getPortAndAddress(settings); if (address) { - attributes[ATTR_SERVER_ADDRESS] = address; + attributes[SERVER_ADDRESS] = address; } if (port) { - attributes[ATTR_SERVER_PORT] = port; + attributes[SERVER_PORT] = port; } span.setAttributes(attributes); diff --git a/packages/node/src/integrations/tracing/hapi/vendored/semconv.ts b/packages/node/src/integrations/tracing/hapi/vendored/semconv.ts deleted file mode 100644 index 47a95d66f4e8..000000000000 --- a/packages/node/src/integrations/tracing/hapi/vendored/semconv.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - * - * NOTICE from the Sentry authors: - * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-hapi - * - Upstream version: @opentelemetry/instrumentation-hapi@0.64.0 - */ -/* eslint-disable */ - -/** - * Deprecated, use `http.request.method` instead. - * - * @example GET - * @example POST - * @example HEAD - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated Replaced by `http.request.method`. - */ -export const ATTR_HTTP_METHOD = 'http.method' as const; diff --git a/packages/node/src/integrations/tracing/hapi/vendored/utils.ts b/packages/node/src/integrations/tracing/hapi/vendored/utils.ts index 1c68fb2690f9..0b35c8bac885 100644 --- a/packages/node/src/integrations/tracing/hapi/vendored/utils.ts +++ b/packages/node/src/integrations/tracing/hapi/vendored/utils.ts @@ -9,8 +9,7 @@ */ import type { Attributes } from '@opentelemetry/api'; -import { ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions'; -import { ATTR_HTTP_METHOD } from './semconv'; +import { HTTP_METHOD, HTTP_ROUTE } from '@sentry/conventions/attributes'; import type * as Hapi from './hapi-types'; import { HapiLayerType, @@ -63,9 +62,9 @@ export const getRouteMetadata = ( name: string; } => { const attributes: Attributes = { - [ATTR_HTTP_ROUTE]: route.path, + [HTTP_ROUTE]: route.path, // eslint-disable-next-line typescript/no-deprecated - [ATTR_HTTP_METHOD]: route.method, + [HTTP_METHOD]: route.method, }; let name; diff --git a/packages/node/src/integrations/tracing/hono/index.ts b/packages/node/src/integrations/tracing/hono/index.ts index 6b908ae96dee..4848fb2033ea 100644 --- a/packages/node/src/integrations/tracing/hono/index.ts +++ b/packages/node/src/integrations/tracing/hono/index.ts @@ -1,4 +1,4 @@ -import { ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions'; +import { HTTP_REQUEST_METHOD, HTTP_ROUTE } from '@sentry/conventions/attributes'; import type { IntegrationFn, Span } from '@sentry/core'; import { captureException, @@ -41,8 +41,8 @@ function addHonoSpanAttributes(span: Span): void { return; } - const route = attributes[ATTR_HTTP_ROUTE]; - const method = attributes[ATTR_HTTP_REQUEST_METHOD]; + const route = attributes[HTTP_ROUTE]; + const method = attributes[HTTP_REQUEST_METHOD]; if (typeof route === 'string' && typeof method === 'string') { getIsolationScope().setTransactionName(`${method} ${route}`); } diff --git a/packages/node/src/integrations/tracing/kafka/vendored/instrumentation.ts b/packages/node/src/integrations/tracing/kafka/vendored/instrumentation.ts index d951cfa561bc..0eb0e235c854 100644 --- a/packages/node/src/integrations/tracing/kafka/vendored/instrumentation.ts +++ b/packages/node/src/integrations/tracing/kafka/vendored/instrumentation.ts @@ -31,11 +31,15 @@ import { safeExecuteInTheMiddle, } from '@opentelemetry/instrumentation'; import { - ATTR_ERROR_TYPE, - ATTR_SERVER_ADDRESS, - ATTR_SERVER_PORT, - ERROR_TYPE_VALUE_OTHER, -} from '@opentelemetry/semantic-conventions'; + ERROR_TYPE, + MESSAGING_BATCH_MESSAGE_COUNT, + MESSAGING_DESTINATION_NAME, + MESSAGING_OPERATION_NAME, + MESSAGING_OPERATION_TYPE, + MESSAGING_SYSTEM, + SERVER_ADDRESS, + SERVER_PORT, +} from '@sentry/conventions/attributes'; import type { Kafka, Transaction, Producer, ConsumerEvents, ProducerEvents, RequestEvent } from './kafkajs-types'; import type { Consumer, @@ -49,15 +53,11 @@ import type { import { EVENT_LISTENERS_SET } from './internal-types'; import { bufferTextMapGetter } from './propagator'; import { - ATTR_MESSAGING_BATCH_MESSAGE_COUNT, - ATTR_MESSAGING_DESTINATION_NAME, ATTR_MESSAGING_DESTINATION_PARTITION_ID, ATTR_MESSAGING_KAFKA_MESSAGE_KEY, ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE, ATTR_MESSAGING_KAFKA_OFFSET, - ATTR_MESSAGING_OPERATION_NAME, - ATTR_MESSAGING_OPERATION_TYPE, - ATTR_MESSAGING_SYSTEM, + ERROR_TYPE_VALUE_OTHER, MESSAGING_OPERATION_TYPE_VALUE_PROCESS, MESSAGING_OPERATION_TYPE_VALUE_RECEIVE, MESSAGING_OPERATION_TYPE_VALUE_SEND, @@ -92,28 +92,28 @@ interface KafkaEventEmitter { } interface StandardAttributes extends Attributes { - [ATTR_MESSAGING_SYSTEM]: string; - [ATTR_MESSAGING_OPERATION_NAME]: OP; - [ATTR_ERROR_TYPE]?: string; + [MESSAGING_SYSTEM]: string; + [MESSAGING_OPERATION_NAME]: OP; + [ERROR_TYPE]?: string; } interface TopicAttributes { - [ATTR_MESSAGING_DESTINATION_NAME]: string; + [MESSAGING_DESTINATION_NAME]: string; [ATTR_MESSAGING_DESTINATION_PARTITION_ID]?: string; } interface ClientDurationAttributes extends StandardAttributes, Partial { - [ATTR_SERVER_ADDRESS]: string; - [ATTR_SERVER_PORT]: number; - [ATTR_MESSAGING_OPERATION_TYPE]?: string; + [SERVER_ADDRESS]: string; + [SERVER_PORT]: number; + [MESSAGING_OPERATION_TYPE]?: string; } interface SentMessagesAttributes extends StandardAttributes<'send'>, TopicAttributes { - [ATTR_ERROR_TYPE]?: string; + [ERROR_TYPE]?: string; } type ConsumedMessagesAttributes = StandardAttributes<'receive' | 'process'>; interface MessageProcessDurationAttributes extends StandardAttributes<'process'>, TopicAttributes { - [ATTR_MESSAGING_SYSTEM]: string; - [ATTR_MESSAGING_OPERATION_NAME]: 'process'; - [ATTR_ERROR_TYPE]?: string; + [MESSAGING_SYSTEM]: string; + [MESSAGING_OPERATION_NAME]: 'process'; + [ERROR_TYPE]?: string; } type RecordPendingMetric = (errorType?: string | undefined) => void; @@ -121,7 +121,7 @@ function prepareCounter(meter: Counter, value: number, return (errorType?: string | undefined) => { meter.add(value, { ...attributes, - ...(errorType ? { [ATTR_ERROR_TYPE]: errorType } : {}), + ...(errorType ? { [ERROR_TYPE]: errorType } : {}), }); }; } @@ -134,7 +134,7 @@ function prepareDurationHistogram( return (errorType?: string | undefined) => { meter.record((Date.now() - value) / 1000, { ...attributes, - ...(errorType ? { [ATTR_ERROR_TYPE]: errorType } : {}), + ...(errorType ? { [ERROR_TYPE]: errorType } : {}), }); }; } @@ -219,10 +219,10 @@ export class KafkaJsInstrumentation extends InstrumentationBase) { const [address = '', port = '0'] = event.payload.broker.split(':'); this._clientDuration.record(event.payload.duration / 1000, { - [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA, - [ATTR_MESSAGING_OPERATION_NAME]: `${event.payload.apiName}`, - [ATTR_SERVER_ADDRESS]: address, - [ATTR_SERVER_PORT]: Number.parseInt(port, 10), + [MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA, + [MESSAGING_OPERATION_NAME]: `${event.payload.apiName}`, + [SERVER_ADDRESS]: address, + [SERVER_PORT]: Number.parseInt(port, 10), }); } @@ -298,15 +298,15 @@ export class KafkaJsInstrumentation extends InstrumentationBase prepareCounter(instrumentation._sentMessages, 1, { - [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA, - [ATTR_MESSAGING_OPERATION_NAME]: 'send', - [ATTR_MESSAGING_DESTINATION_NAME]: record.topic, + [MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA, + [MESSAGING_OPERATION_NAME]: 'send', + [MESSAGING_DESTINATION_NAME]: record.topic, ...(m.partition !== undefined ? { [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(m.partition), @@ -542,7 +542,7 @@ export class KafkaJsInstrumentation extends InstrumentationBase m(errorType)); spans.forEach(span => { - span.setAttribute(ATTR_ERROR_TYPE, errorType); + span.setAttribute(ERROR_TYPE, errorType); span.setStatus({ code: SpanStatusCode.ERROR, message: errorMessage, @@ -568,10 +568,10 @@ export class KafkaJsInstrumentation extends InstrumentationBase { - const route = metadata.attributes[ATTR_HTTP_ROUTE]; + const route = metadata.attributes[HTTP_ROUTE]; if (getIsolationScope() === getDefaultIsolationScope()) { DEBUG_BUILD && debug.warn('Isolation scope is default isolation scope - skipping setting transactionName'); } else if (route) { diff --git a/packages/node/src/integrations/tracing/koa/vendored/utils.ts b/packages/node/src/integrations/tracing/koa/vendored/utils.ts index f052b1385d9a..1c9d9a8067a9 100644 --- a/packages/node/src/integrations/tracing/koa/vendored/utils.ts +++ b/packages/node/src/integrations/tracing/koa/vendored/utils.ts @@ -11,7 +11,7 @@ import { KoaLayerType, type KoaInstrumentationConfig } from './types'; import type { KoaContext, KoaMiddleware } from './internal-types'; import { AttributeNames } from './enums/AttributeNames'; import type { Attributes } from '@opentelemetry/api'; -import { ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions'; +import { HTTP_ROUTE } from '@sentry/conventions/attributes'; export const getMiddlewareMetadata = ( context: KoaContext, @@ -27,7 +27,7 @@ export const getMiddlewareMetadata = ( attributes: { [AttributeNames.KOA_NAME]: layerPath?.toString(), [AttributeNames.KOA_TYPE]: KoaLayerType.ROUTER, - [ATTR_HTTP_ROUTE]: layerPath?.toString(), + [HTTP_ROUTE]: layerPath?.toString(), }, name: context._matchedRouteName || `router - ${layerPath}`, }; diff --git a/packages/node/src/integrations/tracing/mongo/vendored/instrumentation.ts b/packages/node/src/integrations/tracing/mongo/vendored/instrumentation.ts index 11986a0d6c68..f435c5ea7f83 100644 --- a/packages/node/src/integrations/tracing/mongo/vendored/instrumentation.ts +++ b/packages/node/src/integrations/tracing/mongo/vendored/instrumentation.ts @@ -17,23 +17,23 @@ import { SemconvStability, semconvStabilityFromStr, } from '@opentelemetry/instrumentation'; -import { InstrumentationNodeModuleFile } from '../../InstrumentationNodeModuleFile'; import { - ATTR_DB_COLLECTION_NAME, - ATTR_DB_NAMESPACE, - ATTR_DB_OPERATION_NAME, - ATTR_DB_QUERY_TEXT, - ATTR_DB_SYSTEM_NAME, - ATTR_SERVER_ADDRESS, - ATTR_SERVER_PORT, -} from '@opentelemetry/semantic-conventions'; + DB_COLLECTION_NAME, + DB_NAME, + DB_NAMESPACE, + DB_OPERATION, + DB_OPERATION_NAME, + DB_QUERY_TEXT, + DB_STATEMENT, + DB_SYSTEM, + DB_SYSTEM_NAME, + SERVER_ADDRESS, + SERVER_PORT, +} from '@sentry/conventions/attributes'; +import { InstrumentationNodeModuleFile } from '../../InstrumentationNodeModuleFile'; import { ATTR_DB_CONNECTION_STRING, ATTR_DB_MONGODB_COLLECTION, - ATTR_DB_NAME, - ATTR_DB_OPERATION, - ATTR_DB_STATEMENT, - ATTR_DB_SYSTEM, ATTR_NET_PEER_NAME, ATTR_NET_PEER_PORT, DB_SYSTEM_NAME_VALUE_MONGODB, @@ -728,17 +728,17 @@ export class MongoDBInstrumentation extends InstrumentationBase { const query = dbStatementSerializer(commandObj); if (this._dbSemconvStability & SemconvStability.OLD) { - attributes[ATTR_DB_STATEMENT] = query; + attributes[DB_STATEMENT] = query; } if (this._dbSemconvStability & SemconvStability.STABLE) { - attributes[ATTR_DB_QUERY_TEXT] = query; + attributes[DB_QUERY_TEXT] = query; } }, err => { @@ -793,10 +793,10 @@ export class MongoDBInstrumentation extends InstrumentationBase attr).join(' ') || + [attributes[DB_OPERATION_NAME], attributes[DB_COLLECTION_NAME]].filter(attr => attr).join(' ') || DB_SYSTEM_NAME_VALUE_MONGODB; } else { - spanName = `mongodb.${attributes[ATTR_DB_OPERATION] || 'command'}`; + spanName = `mongodb.${attributes[DB_OPERATION] || 'command'}`; } return spanName; } diff --git a/packages/node/src/integrations/tracing/mongo/vendored/semconv.ts b/packages/node/src/integrations/tracing/mongo/vendored/semconv.ts index 1d150a87edb3..0ab24caca814 100644 --- a/packages/node/src/integrations/tracing/mongo/vendored/semconv.ts +++ b/packages/node/src/integrations/tracing/mongo/vendored/semconv.ts @@ -19,8 +19,6 @@ * * @example "Server=(localdb)\\v11.0;Integrated Security=true;" * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * * @deprecated Replaced by `server.address` and `server.port`. */ export const ATTR_DB_CONNECTION_STRING = 'db.connection_string' as const; @@ -30,65 +28,15 @@ export const ATTR_DB_CONNECTION_STRING = 'db.connection_string' as const; * * @example "mytable" * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * * @deprecated Replaced by `db.collection.name`. */ export const ATTR_DB_MONGODB_COLLECTION = 'db.mongodb.collection' as const; -/** - * Deprecated, use `db.namespace` instead. - * - * @example customers - * @example main - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated Replaced by `db.namespace`. - */ -export const ATTR_DB_NAME = 'db.name' as const; - -/** - * Deprecated, use `db.operation.name` instead. - * - * @example findAndModify - * @example HMSET - * @example SELECT - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated Replaced by `db.operation.name`. - */ -export const ATTR_DB_OPERATION = 'db.operation' as const; - -/** - * The database statement being executed. - * - * @example SELECT * FROM wuser_table - * @example SET mykey "WuValue" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated Replaced by `db.query.text`. - */ -export const ATTR_DB_STATEMENT = 'db.statement' as const; - -/** - * Deprecated, use `db.system.name` instead. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated Replaced by `db.system.name`. - */ -export const ATTR_DB_SYSTEM = 'db.system' as const; - /** * Deprecated, use `server.address` on client spans and `client.address` on server spans. * * @example example.com * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * * @deprecated Replaced by `server.address` on client spans and `client.address` on server spans. */ export const ATTR_NET_PEER_NAME = 'net.peer.name' as const; @@ -98,35 +46,29 @@ export const ATTR_NET_PEER_NAME = 'net.peer.name' as const; * * @example 8080 * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * * @deprecated Replaced by `server.port` on client spans and `client.port` on server spans. */ export const ATTR_NET_PEER_PORT = 'net.peer.port' as const; /** - * Enum value "mongodb" for attribute {@link ATTR_DB_SYSTEM_NAME}. + * Enum value "mongodb" for attribute `db.system.name`. * * [MongoDB](https://www.mongodb.com/) * - * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ export const DB_SYSTEM_NAME_VALUE_MONGODB = 'mongodb' as const; /** - * Enum value "mongodb" for attribute {@link ATTR_DB_SYSTEM}. + * Enum value "mongodb" for attribute `db.system`. * * MongoDB * - * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ export const DB_SYSTEM_VALUE_MONGODB = 'mongodb' as const; /** * Deprecated, use `db.client.connection.count` instead. * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * * @deprecated Replaced by `db.client.connection.count`. */ export const METRIC_DB_CLIENT_CONNECTIONS_USAGE = 'db.client.connections.usage' as const; diff --git a/packages/node/src/integrations/tracing/mongoose/vendored/mongoose.ts b/packages/node/src/integrations/tracing/mongoose/vendored/mongoose.ts index d6c7602c8ba9..d7ee3b54c147 100644 --- a/packages/node/src/integrations/tracing/mongoose/vendored/mongoose.ts +++ b/packages/node/src/integrations/tracing/mongoose/vendored/mongoose.ts @@ -17,6 +17,7 @@ import { type InstrumentationModuleDefinition, InstrumentationNodeModuleDefinition, } from '@opentelemetry/instrumentation'; +import { DB_OPERATION, DB_SYSTEM } from '@sentry/conventions/attributes'; import type { Span, SpanAttributes } from '@sentry/core'; import { getActiveSpan, @@ -26,7 +27,6 @@ import { withActiveSpan, } from '@sentry/core'; import type * as mongoose from './mongoose-types'; -import { ATTR_DB_OPERATION, ATTR_DB_SYSTEM } from './semconv'; import { getAttributesFromCollection, handleCallbackResponse, handlePromiseResponse } from './utils'; const PACKAGE_NAME = '@sentry/instrumentation-mongoose'; @@ -298,9 +298,9 @@ export class MongooseInstrumentation extends InstrumentationBase { @@ -304,14 +298,14 @@ export class PgInstrumentation extends InstrumentationBase { diff --git a/packages/node/src/integrations/tracing/postgres/vendored/semconv.ts b/packages/node/src/integrations/tracing/postgres/vendored/semconv.ts index ed3036322200..f101b2792161 100644 --- a/packages/node/src/integrations/tracing/postgres/vendored/semconv.ts +++ b/packages/node/src/integrations/tracing/postgres/vendored/semconv.ts @@ -18,8 +18,6 @@ * The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation **SHOULD** use a combination of parameters that would make the name unique, for example, combining attributes `server.address`, `server.port`, and `db.namespace`, formatted as `server.address:server.port/db.namespace`. Instrumentations that generate connection pool name following different patterns **SHOULD** document it. * * @example myDataSource - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ export const ATTR_DB_CLIENT_CONNECTION_POOL_NAME = 'db.client.connection.pool.name' as const; @@ -27,8 +25,6 @@ export const ATTR_DB_CLIENT_CONNECTION_POOL_NAME = 'db.client.connection.pool.na * The state of a connection in the pool * * @example idle - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ export const ATTR_DB_CLIENT_CONNECTION_STATE = 'db.client.connection.state' as const; @@ -37,64 +33,15 @@ export const ATTR_DB_CLIENT_CONNECTION_STATE = 'db.client.connection.state' as c * * @example "Server=(localdb)\\v11.0;Integrated Security=true;" * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * * @deprecated Replaced by `server.address` and `server.port`. */ export const ATTR_DB_CONNECTION_STRING = 'db.connection_string' as const; -/** - * Deprecated, use `db.namespace` instead. - * - * @example customers - * @example main - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated Replaced by `db.namespace`. - */ -export const ATTR_DB_NAME = 'db.name' as const; - -/** - * The database statement being executed. - * - * @example SELECT * FROM wuser_table - * @example SET mykey "WuValue" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated Replaced by `db.query.text`. - */ -export const ATTR_DB_STATEMENT = 'db.statement' as const; - -/** - * Deprecated, use `db.system.name` instead. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated Replaced by `db.system.name`. - */ -export const ATTR_DB_SYSTEM = 'db.system' as const; - -/** - * Deprecated, no replacement at this time. - * - * @example readonly_user - * @example reporting_user - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated Removed, no replacement at this time. - */ -export const ATTR_DB_USER = 'db.user' as const; - /** * Deprecated, use `server.address` on client spans and `client.address` on server spans. * * @example example.com * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * * @deprecated Replaced by `server.address` on client spans and `client.address` on server spans. */ export const ATTR_NET_PEER_NAME = 'net.peer.name' as const; @@ -104,8 +51,6 @@ export const ATTR_NET_PEER_NAME = 'net.peer.name' as const; * * @example 8080 * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * * @deprecated Replaced by `server.port` on client spans and `client.port` on server spans. */ export const ATTR_NET_PEER_PORT = 'net.peer.port' as const; @@ -121,20 +66,27 @@ export const DB_CLIENT_CONNECTION_STATE_VALUE_IDLE = 'idle' as const; export const DB_CLIENT_CONNECTION_STATE_VALUE_USED = 'used' as const; /** - * Enum value "postgresql" for attribute {@link ATTR_DB_SYSTEM}. + * Enum value "postgresql" for attribute `db.system`. */ export const DB_SYSTEM_VALUE_POSTGRESQL = 'postgresql' as const; /** - * The number of connections that are currently in state described by the `state` attribute + * Enum value "postgresql" for attribute `db.system.name`. + */ +export const DB_SYSTEM_NAME_VALUE_POSTGRESQL = 'postgresql' as const; + +/** + * Duration of database client operations. * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +export const METRIC_DB_CLIENT_OPERATION_DURATION = 'db.client.operation.duration' as const; + +/** + * The number of connections that are currently in state described by the `state` attribute */ export const METRIC_DB_CLIENT_CONNECTION_COUNT = 'db.client.connection.count' as const; /** * The number of current pending requests for an open connection - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ export const METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS = 'db.client.connection.pending_requests' as const; diff --git a/packages/node/src/integrations/tracing/postgres/vendored/utils.ts b/packages/node/src/integrations/tracing/postgres/vendored/utils.ts index fc009418c4f3..99d7516fc1cf 100644 --- a/packages/node/src/integrations/tracing/postgres/vendored/utils.ts +++ b/packages/node/src/integrations/tracing/postgres/vendored/utils.ts @@ -23,27 +23,27 @@ import { } from '@opentelemetry/api'; import { AttributeNames } from './enums/AttributeNames'; import { - ATTR_ERROR_TYPE, - ATTR_DB_SYSTEM_NAME, - ATTR_DB_NAMESPACE, - ATTR_SERVER_ADDRESS, - ATTR_SERVER_PORT, - ATTR_DB_QUERY_TEXT, - DB_SYSTEM_NAME_VALUE_POSTGRESQL, -} from '@opentelemetry/semantic-conventions'; + DB_NAME, + DB_NAMESPACE, + DB_QUERY_TEXT, + DB_STATEMENT, + DB_SYSTEM, + DB_SYSTEM_NAME, + DB_USER, + ERROR_TYPE, + SERVER_ADDRESS, + SERVER_PORT, +} from '@sentry/conventions/attributes'; import { ATTR_DB_CLIENT_CONNECTION_POOL_NAME, ATTR_DB_CLIENT_CONNECTION_STATE, DB_CLIENT_CONNECTION_STATE_VALUE_USED, DB_CLIENT_CONNECTION_STATE_VALUE_IDLE, - ATTR_DB_SYSTEM, - ATTR_DB_NAME, - ATTR_DB_USER, + DB_SYSTEM_NAME_VALUE_POSTGRESQL, DB_SYSTEM_VALUE_POSTGRESQL, ATTR_DB_CONNECTION_STRING, ATTR_NET_PEER_PORT, ATTR_NET_PEER_NAME, - ATTR_DB_STATEMENT, } from './semconv'; import { PgClientExtended, @@ -150,10 +150,10 @@ export function getSemanticAttributesFromConnection( if (semconvStability & SemconvStability.OLD) { attributes = { ...attributes, - [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_POSTGRESQL, - [ATTR_DB_NAME]: params.database, + [DB_SYSTEM]: DB_SYSTEM_VALUE_POSTGRESQL, + [DB_NAME]: params.database, [ATTR_DB_CONNECTION_STRING]: getConnectionString(params), - [ATTR_DB_USER]: params.user, + [DB_USER]: params.user, [ATTR_NET_PEER_NAME]: params.host, // required [ATTR_NET_PEER_PORT]: getPort(params.port), }; @@ -161,10 +161,10 @@ export function getSemanticAttributesFromConnection( if (semconvStability & SemconvStability.STABLE) { attributes = { ...attributes, - [ATTR_DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_POSTGRESQL, - [ATTR_DB_NAMESPACE]: params.namespace, - [ATTR_SERVER_ADDRESS]: params.host, - [ATTR_SERVER_PORT]: getPort(params.port), + [DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_POSTGRESQL, + [DB_NAMESPACE]: params.namespace, + [SERVER_ADDRESS]: params.host, + [SERVER_PORT]: getPort(params.port), }; } @@ -189,21 +189,21 @@ export function getSemanticAttributesFromPoolConnection( if (semconvStability & SemconvStability.OLD) { attributes = { ...attributes, - [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_POSTGRESQL, - [ATTR_DB_NAME]: url?.pathname.slice(1) ?? params.database, + [DB_SYSTEM]: DB_SYSTEM_VALUE_POSTGRESQL, + [DB_NAME]: url?.pathname.slice(1) ?? params.database, [ATTR_DB_CONNECTION_STRING]: getConnectionString(params), [ATTR_NET_PEER_NAME]: url?.hostname ?? params.host, [ATTR_NET_PEER_PORT]: Number(url?.port) || getPort(params.port), - [ATTR_DB_USER]: url?.username ?? params.user, + [DB_USER]: url?.username ?? params.user, }; } if (semconvStability & SemconvStability.STABLE) { attributes = { ...attributes, - [ATTR_DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_POSTGRESQL, - [ATTR_DB_NAMESPACE]: params.namespace, - [ATTR_SERVER_ADDRESS]: url?.hostname ?? params.host, - [ATTR_SERVER_PORT]: Number(url?.port) || getPort(params.port), + [DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_POSTGRESQL, + [DB_NAMESPACE]: params.namespace, + [SERVER_ADDRESS]: url?.hostname ?? params.host, + [SERVER_PORT]: Number(url?.port) || getPort(params.port), }; } @@ -240,10 +240,10 @@ export function handleConfigQuery( // Set attributes if (queryConfig.text) { if (semconvStability & SemconvStability.OLD) { - span.setAttribute(ATTR_DB_STATEMENT, queryConfig.text); + span.setAttribute(DB_STATEMENT, queryConfig.text); } if (semconvStability & SemconvStability.STABLE) { - span.setAttribute(ATTR_DB_QUERY_TEXT, queryConfig.text); + span.setAttribute(DB_QUERY_TEXT, queryConfig.text); } } @@ -310,7 +310,7 @@ export function patchCallback( return function patchedCallback(this: PgClientExtended, err: Error, res: object) { if (err) { if (Object.prototype.hasOwnProperty.call(err, 'code')) { - attributes[ATTR_ERROR_TYPE] = (err as any)['code']; + attributes[ERROR_TYPE] = (err as any)['code']; } if (err instanceof Error) { span.recordException(sanitizedErrorMessage(err)); diff --git a/packages/node/src/integrations/tracing/postgresjs.ts b/packages/node/src/integrations/tracing/postgresjs.ts index 62f9a01ccfc8..c5cf013ae5ec 100644 --- a/packages/node/src/integrations/tracing/postgresjs.ts +++ b/packages/node/src/integrations/tracing/postgresjs.ts @@ -8,13 +8,7 @@ import { safeExecuteInTheMiddle, } from '@opentelemetry/instrumentation'; import { InstrumentationNodeModuleFile } from './InstrumentationNodeModuleFile'; -import { - ATTR_DB_OPERATION_NAME, - ATTR_DB_QUERY_TEXT, - ATTR_DB_RESPONSE_STATUS_CODE, - ATTR_DB_SYSTEM_NAME, - ATTR_ERROR_TYPE, -} from '@opentelemetry/semantic-conventions'; +import { DB_OPERATION_NAME, DB_QUERY_TEXT, DB_SYSTEM_NAME, ERROR_TYPE } from '@sentry/conventions/attributes'; import type { IntegrationFn, Span } from '@sentry/core'; import { debug, @@ -30,6 +24,7 @@ import { DEBUG_BUILD } from '../../debug-build'; const INTEGRATION_NAME = 'PostgresJs'; const SUPPORTED_VERSIONS = ['>=3.0.0 <4']; +const ATTR_DB_RESPONSE_STATUS_CODE = 'db.response.status_code'; const SQL_OPERATION_REGEX = /^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i; type PostgresConnectionContext = { @@ -187,13 +182,13 @@ export class PostgresJsInstrumentation extends InstrumentationBase=4 uses `authentication` object; older versions just userName and password pair // eslint-disable-next-line typescript/no-deprecated - [ATTR_DB_USER]: this.config?.userName ?? this.config?.authentication?.options?.userName, + [DB_USER]: this.config?.userName ?? this.config?.authentication?.options?.userName, // eslint-disable-next-line typescript/no-deprecated - [ATTR_DB_STATEMENT]: sql, + [DB_STATEMENT]: sql, // eslint-disable-next-line typescript/no-deprecated [ATTR_DB_SQL_TABLE]: request.table, // eslint-disable-next-line typescript/no-deprecated diff --git a/packages/node/src/integrations/tracing/tedious/vendored/semconv.ts b/packages/node/src/integrations/tracing/tedious/vendored/semconv.ts index 4b999bed7ff5..f336df59a16b 100644 --- a/packages/node/src/integrations/tracing/tedious/vendored/semconv.ts +++ b/packages/node/src/integrations/tracing/tedious/vendored/semconv.ts @@ -13,69 +13,20 @@ * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv */ -/** - * Deprecated, use `db.namespace` instead. - * - * @example customers - * @example main - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated Replaced by `db.namespace`. - */ -export const ATTR_DB_NAME = 'db.name' as const; - /** * Deprecated, use `db.collection.name` instead. * * @example "mytable" * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * * @deprecated Replaced by `db.collection.name`, but only if not extracting the value from `db.query.text`. */ export const ATTR_DB_SQL_TABLE = 'db.sql.table' as const; -/** - * The database statement being executed. - * - * @example SELECT * FROM wuser_table - * @example SET mykey "WuValue" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated Replaced by `db.query.text`. - */ -export const ATTR_DB_STATEMENT = 'db.statement' as const; - -/** - * Deprecated, use `db.system.name` instead. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated Replaced by `db.system.name`. - */ -export const ATTR_DB_SYSTEM = 'db.system' as const; - -/** - * Deprecated, no replacement at this time. - * - * @example readonly_user - * @example reporting_user - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated Removed, no replacement at this time. - */ -export const ATTR_DB_USER = 'db.user' as const; - /** * Deprecated, use `server.address` on client spans and `client.address` on server spans. * * @example example.com * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * * @deprecated Replaced by `server.address` on client spans and `client.address` on server spans. */ export const ATTR_NET_PEER_NAME = 'net.peer.name' as const; @@ -85,17 +36,14 @@ export const ATTR_NET_PEER_NAME = 'net.peer.name' as const; * * @example 8080 * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * * @deprecated Replaced by `server.port` on client spans and `client.port` on server spans. */ export const ATTR_NET_PEER_PORT = 'net.peer.port' as const; /** - * Enum value "mssql" for attribute {@link ATTR_DB_SYSTEM}. + * Enum value "mssql" for attribute `db.system`. * * Microsoft SQL Server * - * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ export const DB_SYSTEM_VALUE_MSSQL = 'mssql' as const;