From 38347348858cf500fb65edb3a44d2700dbc71250 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Thu, 18 Jun 2026 15:59:12 +0200 Subject: [PATCH 1/2] first step --- packages/node/package.json | 1 + .../node-fetch/vendored/undici.ts | 62 +++++----- .../tracing/amqplib/vendored/semconv.ts | 9 -- .../tracing/amqplib/vendored/utils.ts | 14 +-- .../connect/vendored/instrumentation.ts | 4 +- .../tracing/fastify/v3/instrumentation.ts | 5 +- .../fastify/vendored/instrumentation.ts | 23 ++-- .../firebase/otel/patches/firestore.ts | 26 ++--- .../tracing/hapi/vendored/semconv.ts | 22 ---- .../tracing/hapi/vendored/utils.ts | 7 +- .../src/integrations/tracing/hono/index.ts | 6 +- .../tracing/kafka/vendored/instrumentation.ts | 110 +++++++++--------- .../tracing/kafka/vendored/semconv.ts | 62 +--------- .../tracing/knex/vendored/instrumentation.ts | 57 +++++---- .../tracing/knex/vendored/semconv.ts | 25 ---- .../tracing/koa/vendored/instrumentation.ts | 4 +- .../tracing/koa/vendored/utils.ts | 4 +- .../tracing/mongo/vendored/instrumentation.ts | 52 ++++----- .../tracing/mongo/vendored/semconv.ts | 50 +------- .../tracing/mongoose/vendored/mongoose.ts | 6 +- .../tracing/mongoose/vendored/semconv.ts | 36 ------ .../tracing/mongoose/vendored/utils.ts | 13 +-- .../tracing/mysql/vendored/instrumentation.ts | 40 +++---- .../tracing/mysql/vendored/semconv.ts | 47 +------- .../mysql2/vendored/instrumentation.ts | 9 +- .../tracing/mysql2/vendored/semconv.ts | 4 - .../tracing/mysql2/vendored/utils.ts | 14 +-- .../postgres/vendored/instrumentation.ts | 40 +++---- .../tracing/postgres/vendored/semconv.ts | 47 +------- .../tracing/postgres/vendored/utils.ts | 58 ++++----- .../src/integrations/tracing/postgresjs.ts | 19 ++- .../redis/vendored/ioredis-instrumentation.ts | 22 ++-- .../redis/vendored/redis-instrumentation.ts | 22 ++-- .../tracing/redis/vendored/semconv.ts | 2 - .../tedious/vendored/instrumentation.ts | 20 +--- .../tracing/tedious/vendored/semconv.ts | 47 +------- 36 files changed, 309 insertions(+), 680 deletions(-) delete mode 100644 packages/node/src/integrations/tracing/hapi/vendored/semconv.ts diff --git a/packages/node/package.json b/packages/node/package.json index 6914dbb75ab0..b1deb21ba3d3 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -70,6 +70,7 @@ "@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/undici.ts b/packages/node/src/integrations/node-fetch/vendored/undici.ts index 0ab187ab4007..1c748ed9942f 100644 --- a/packages/node/src/integrations/node-fetch/vendored/undici.ts +++ b/packages/node/src/integrations/node-fetch/vendored/undici.ts @@ -25,21 +25,23 @@ import { ValueType, } from '@opentelemetry/api'; 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'; +import { + 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 +227,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 +253,7 @@ export class UndiciInstrumentation extends InstrumentationBase { if (key in attributes) { diff --git a/packages/node/src/integrations/tracing/amqplib/vendored/semconv.ts b/packages/node/src/integrations/tracing/amqplib/vendored/semconv.ts index e72194c62ad3..19f9544f44f1 100644 --- a/packages/node/src/integrations/tracing/amqplib/vendored/semconv.ts +++ b/packages/node/src/integrations/tracing/amqplib/vendored/semconv.ts @@ -27,15 +27,6 @@ */ 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. * 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..2d29daed270d 100644 --- a/packages/node/src/integrations/tracing/kafka/vendored/instrumentation.ts +++ b/packages/node/src/integrations/tracing/kafka/vendored/instrumentation.ts @@ -30,12 +30,17 @@ import { isWrapped, safeExecuteInTheMiddle, } from '@opentelemetry/instrumentation'; +import { ERROR_TYPE_VALUE_OTHER } from '@opentelemetry/semantic-conventions'; 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 +54,10 @@ 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, 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..8a1b4e361578 100644 --- a/packages/node/src/integrations/tracing/mongo/vendored/semconv.ts +++ b/packages/node/src/integrations/tracing/mongo/vendored/semconv.ts @@ -36,52 +36,6 @@ export const ATTR_DB_CONNECTION_STRING = 'db.connection_string' as const; */ 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. * @@ -105,7 +59,7 @@ export const ATTR_NET_PEER_NAME = 'net.peer.name' as const; 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/) * @@ -114,7 +68,7 @@ export const ATTR_NET_PEER_PORT = 'net.peer.port' as const; 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 * 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..343fd9db8d27 100644 --- a/packages/node/src/integrations/tracing/postgres/vendored/semconv.ts +++ b/packages/node/src/integrations/tracing/postgres/vendored/semconv.ts @@ -43,51 +43,6 @@ export const ATTR_DB_CLIENT_CONNECTION_STATE = 'db.client.connection.state' as c */ 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. * @@ -121,7 +76,7 @@ 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; diff --git a/packages/node/src/integrations/tracing/postgres/vendored/utils.ts b/packages/node/src/integrations/tracing/postgres/vendored/utils.ts index fc009418c4f3..7c1c59dfacc3 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 { DB_SYSTEM_NAME_VALUE_POSTGRESQL } from '@opentelemetry/semantic-conventions'; 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_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..3e1ec964a42f 100644 --- a/packages/node/src/integrations/tracing/postgresjs.ts +++ b/packages/node/src/integrations/tracing/postgresjs.ts @@ -8,13 +8,8 @@ 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 { ATTR_DB_RESPONSE_STATUS_CODE } 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, @@ -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..2c21943eb34f 100644 --- a/packages/node/src/integrations/tracing/tedious/vendored/semconv.ts +++ b/packages/node/src/integrations/tracing/tedious/vendored/semconv.ts @@ -13,18 +13,6 @@ * @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. * @@ -36,39 +24,6 @@ export const ATTR_DB_NAME = 'db.name' as const; */ 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. * @@ -92,7 +47,7 @@ export const ATTR_NET_PEER_NAME = 'net.peer.name' as const; 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 * From 8ed390c4525347b00907185af532b437dc2cb316 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Thu, 18 Jun 2026 16:17:21 +0200 Subject: [PATCH 2/2] second pass --- packages/node/package.json | 1 - .../node-fetch/vendored/semconv.ts | 9 +++++++ .../node-fetch/vendored/undici.ts | 5 +--- .../amqplib/vendored/semconv-obsolete.ts | 9 ------- .../tracing/amqplib/vendored/semconv.ts | 6 ----- .../tracing/kafka/vendored/instrumentation.ts | 2 +- .../tracing/kafka/vendored/semconv.ts | 14 +++++------ .../tracing/knex/vendored/semconv.ts | 2 ++ .../tracing/knex/vendored/utils.ts | 3 +-- .../tracing/mongo/vendored/semconv.ts | 12 --------- .../tracing/mongoose/vendored/semconv.ts | 6 ----- .../tracing/mysql/vendored/instrumentation.ts | 2 +- .../tracing/mysql/vendored/semconv.ts | 14 ++++------- .../postgres/vendored/instrumentation.ts | 2 +- .../tracing/postgres/vendored/semconv.ts | 25 ++++++++----------- .../tracing/postgres/vendored/utils.ts | 2 +- .../src/integrations/tracing/postgresjs.ts | 2 +- .../tracing/tedious/vendored/semconv.ts | 7 ------ 18 files changed, 40 insertions(+), 83 deletions(-) create mode 100644 packages/node/src/integrations/node-fetch/vendored/semconv.ts diff --git a/packages/node/package.json b/packages/node/package.json index b1deb21ba3d3..694f9882b3c2 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -69,7 +69,6 @@ "@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", 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 1c748ed9942f..8a5c7d2a5f63 100644 --- a/packages/node/src/integrations/node-fetch/vendored/undici.ts +++ b/packages/node/src/integrations/node-fetch/vendored/undici.ts @@ -24,10 +24,7 @@ import { trace, ValueType, } from '@opentelemetry/api'; -import { - ATTR_HTTP_REQUEST_METHOD_ORIGINAL, - METRIC_HTTP_CLIENT_REQUEST_DURATION, -} from '@opentelemetry/semantic-conventions'; +import { ATTR_HTTP_REQUEST_METHOD_ORIGINAL, METRIC_HTTP_CLIENT_REQUEST_DURATION } from './semconv'; import { ERROR_TYPE, HTTP_REQUEST_METHOD, 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 19f9544f44f1..321d0dec7e82 100644 --- a/packages/node/src/integrations/tracing/amqplib/vendored/semconv.ts +++ b/packages/node/src/integrations/tracing/amqplib/vendored/semconv.ts @@ -21,8 +21,6 @@ * @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; @@ -32,8 +30,6 @@ export const ATTR_MESSAGING_OPERATION = 'messaging.operation' as const; * * @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; @@ -43,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/kafka/vendored/instrumentation.ts b/packages/node/src/integrations/tracing/kafka/vendored/instrumentation.ts index 2d29daed270d..0eb0e235c854 100644 --- a/packages/node/src/integrations/tracing/kafka/vendored/instrumentation.ts +++ b/packages/node/src/integrations/tracing/kafka/vendored/instrumentation.ts @@ -30,7 +30,6 @@ import { isWrapped, safeExecuteInTheMiddle, } from '@opentelemetry/instrumentation'; -import { ERROR_TYPE_VALUE_OTHER } from '@opentelemetry/semantic-conventions'; import { ERROR_TYPE, MESSAGING_BATCH_MESSAGE_COUNT, @@ -58,6 +57,7 @@ import { ATTR_MESSAGING_KAFKA_MESSAGE_KEY, ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE, ATTR_MESSAGING_KAFKA_OFFSET, + ERROR_TYPE_VALUE_OTHER, MESSAGING_OPERATION_TYPE_VALUE_PROCESS, MESSAGING_OPERATION_TYPE_VALUE_RECEIVE, MESSAGING_OPERATION_TYPE_VALUE_SEND, diff --git a/packages/node/src/integrations/tracing/kafka/vendored/semconv.ts b/packages/node/src/integrations/tracing/kafka/vendored/semconv.ts index dcaad02bdd7d..f5d1891e1cb0 100644 --- a/packages/node/src/integrations/tracing/kafka/vendored/semconv.ts +++ b/packages/node/src/integrations/tracing/kafka/vendored/semconv.ts @@ -19,7 +19,6 @@ * * @example "1" * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ export const ATTR_MESSAGING_DESTINATION_PARTITION_ID = 'messaging.destination.partition.id' as const; @@ -30,14 +29,12 @@ export const ATTR_MESSAGING_DESTINATION_PARTITION_ID = 'messaging.destination.pa * * @note If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ export const ATTR_MESSAGING_KAFKA_MESSAGE_KEY = 'messaging.kafka.message.key' as const; /** * A boolean that is true if the message is a tombstone. * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ export const ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE = 'messaging.kafka.message.tombstone' as const; @@ -46,7 +43,6 @@ export const ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE = 'messaging.kafka.message.t * * @example 42 * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ export const ATTR_MESSAGING_KAFKA_OFFSET = 'messaging.kafka.offset' as const; @@ -70,13 +66,18 @@ export const MESSAGING_OPERATION_TYPE_VALUE_SEND = 'send' as const; */ export const MESSAGING_SYSTEM_VALUE_KAFKA = 'kafka' as const; +/** + * Enum value "_OTHER" for attribute `error.type`. A fallback error value to be used when the + * instrumentation doesn't define a custom value. + */ +export const ERROR_TYPE_VALUE_OTHER = '_OTHER' as const; + /** * Number of messages that were delivered to the application. * * @note Records the number of messages pulled from the broker or number of messages dispatched to the application in push-based scenarios. * The metric **SHOULD** be reported once per message delivery. For example, if receiving and processing operations are both instrumented for a single message delivery, this counter is incremented when the message is received and not reported when it is processed. * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ export const METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES = 'messaging.client.consumed.messages' as const; @@ -85,7 +86,6 @@ export const METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES = 'messaging.client.consu * * @note This metric **SHOULD NOT** be used to report processing duration - processing duration is reported in `messaging.process.duration` metric. * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ export const METRIC_MESSAGING_CLIENT_OPERATION_DURATION = 'messaging.client.operation.duration' as const; @@ -94,7 +94,6 @@ export const METRIC_MESSAGING_CLIENT_OPERATION_DURATION = 'messaging.client.oper * * @note This metric **MUST NOT** count messages that were created but haven't yet been sent. * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ export const METRIC_MESSAGING_CLIENT_SENT_MESSAGES = 'messaging.client.sent.messages' as const; @@ -103,6 +102,5 @@ export const METRIC_MESSAGING_CLIENT_SENT_MESSAGES = 'messaging.client.sent.mess * * @note This metric **MUST** be reported for operations with `messaging.operation.type` that matches `process`. * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ export const METRIC_MESSAGING_PROCESS_DURATION = 'messaging.process.duration' as const; diff --git a/packages/node/src/integrations/tracing/knex/vendored/semconv.ts b/packages/node/src/integrations/tracing/knex/vendored/semconv.ts index 66445e3fc6db..e862d07ddb74 100644 --- a/packages/node/src/integrations/tracing/knex/vendored/semconv.ts +++ b/packages/node/src/integrations/tracing/knex/vendored/semconv.ts @@ -29,3 +29,5 @@ export const ATTR_NET_PEER_PORT = 'net.peer.port' as const; export const ATTR_NET_TRANSPORT = 'net.transport' as const; export const DB_SYSTEM_NAME_VALUE_SQLITE = 'sqlite' as const; + +export const DB_SYSTEM_NAME_VALUE_POSTGRESQL = 'postgresql' as const; diff --git a/packages/node/src/integrations/tracing/knex/vendored/utils.ts b/packages/node/src/integrations/tracing/knex/vendored/utils.ts index c9e1493bac26..23b30c935a62 100644 --- a/packages/node/src/integrations/tracing/knex/vendored/utils.ts +++ b/packages/node/src/integrations/tracing/knex/vendored/utils.ts @@ -9,8 +9,7 @@ /* eslint-disable */ import { Exception } from '@opentelemetry/api'; -import { DB_SYSTEM_NAME_VALUE_POSTGRESQL } from '@opentelemetry/semantic-conventions'; -import { DB_SYSTEM_NAME_VALUE_SQLITE } from './semconv'; +import { DB_SYSTEM_NAME_VALUE_POSTGRESQL, DB_SYSTEM_NAME_VALUE_SQLITE } from './semconv'; type KnexError = Error & { code?: string; diff --git a/packages/node/src/integrations/tracing/mongo/vendored/semconv.ts b/packages/node/src/integrations/tracing/mongo/vendored/semconv.ts index 8a1b4e361578..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,8 +28,6 @@ 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; @@ -41,8 +37,6 @@ export const ATTR_DB_MONGODB_COLLECTION = 'db.mongodb.collection' as const; * * @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 +46,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; @@ -63,7 +55,6 @@ export const ATTR_NET_PEER_PORT = 'net.peer.port' as const; * * [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; @@ -72,15 +63,12 @@ export const DB_SYSTEM_NAME_VALUE_MONGODB = 'mongodb' as const; * * 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/semconv.ts b/packages/node/src/integrations/tracing/mongoose/vendored/semconv.ts index cd23a677ea5d..cd0aa27e2d21 100644 --- a/packages/node/src/integrations/tracing/mongoose/vendored/semconv.ts +++ b/packages/node/src/integrations/tracing/mongoose/vendored/semconv.ts @@ -10,8 +10,6 @@ /** * Deprecated, use `db.collection.name` instead. * - * @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; @@ -19,8 +17,6 @@ export const ATTR_DB_MONGODB_COLLECTION = 'db.mongodb.collection' as const; /** * Deprecated, use `server.address` on client spans and `client.address` on server spans. * - * @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; @@ -28,8 +24,6 @@ export const ATTR_NET_PEER_NAME = 'net.peer.name' as const; /** * Deprecated, use `server.port` on client spans and `client.port` on server spans. * - * @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/mysql/vendored/instrumentation.ts b/packages/node/src/integrations/tracing/mysql/vendored/instrumentation.ts index b0c17b922fc5..108bd3455b1a 100644 --- a/packages/node/src/integrations/tracing/mysql/vendored/instrumentation.ts +++ b/packages/node/src/integrations/tracing/mysql/vendored/instrumentation.ts @@ -18,7 +18,6 @@ import { SemconvStability, semconvStabilityFromStr, } from '@opentelemetry/instrumentation'; -import { DB_SYSTEM_NAME_VALUE_MYSQL } from '@opentelemetry/semantic-conventions'; import { DB_NAME, DB_NAMESPACE, @@ -34,6 +33,7 @@ import { ATTR_DB_CONNECTION_STRING, ATTR_NET_PEER_NAME, ATTR_NET_PEER_PORT, + DB_SYSTEM_NAME_VALUE_MYSQL, DB_SYSTEM_VALUE_MYSQL, METRIC_DB_CLIENT_CONNECTIONS_USAGE, } from './semconv'; diff --git a/packages/node/src/integrations/tracing/mysql/vendored/semconv.ts b/packages/node/src/integrations/tracing/mysql/vendored/semconv.ts index d5a9a58ad642..5dbcf9b68c19 100644 --- a/packages/node/src/integrations/tracing/mysql/vendored/semconv.ts +++ b/packages/node/src/integrations/tracing/mysql/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,8 +28,6 @@ export const ATTR_DB_CONNECTION_STRING = 'db.connection_string' as const; * * @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; @@ -41,8 +37,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; @@ -52,15 +46,17 @@ export const ATTR_NET_PEER_PORT = 'net.peer.port' as const; * * MySQL * - * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ export const DB_SYSTEM_VALUE_MYSQL = 'mysql' as const; +/** + * Enum value "mysql" for attribute `db.system.name`. + */ +export const DB_SYSTEM_NAME_VALUE_MYSQL = 'mysql' 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/postgres/vendored/instrumentation.ts b/packages/node/src/integrations/tracing/postgres/vendored/instrumentation.ts index 87da35e0449c..708a89d742ff 100644 --- a/packages/node/src/integrations/tracing/postgres/vendored/instrumentation.ts +++ b/packages/node/src/integrations/tracing/postgres/vendored/instrumentation.ts @@ -54,10 +54,10 @@ import { SERVER_ADDRESS, SERVER_PORT, } from '@sentry/conventions/attributes'; -import { METRIC_DB_CLIENT_OPERATION_DURATION } from '@opentelemetry/semantic-conventions'; import { METRIC_DB_CLIENT_CONNECTION_COUNT, METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS, + METRIC_DB_CLIENT_OPERATION_DURATION, DB_SYSTEM_VALUE_POSTGRESQL, } from './semconv'; diff --git a/packages/node/src/integrations/tracing/postgres/vendored/semconv.ts b/packages/node/src/integrations/tracing/postgres/vendored/semconv.ts index 343fd9db8d27..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,8 +33,6 @@ 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; @@ -48,8 +42,6 @@ export const ATTR_DB_CONNECTION_STRING = 'db.connection_string' as const; * * @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; @@ -59,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; @@ -81,15 +71,22 @@ export const DB_CLIENT_CONNECTION_STATE_VALUE_USED = 'used' as const; 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 7c1c59dfacc3..99d7516fc1cf 100644 --- a/packages/node/src/integrations/tracing/postgres/vendored/utils.ts +++ b/packages/node/src/integrations/tracing/postgres/vendored/utils.ts @@ -34,12 +34,12 @@ import { SERVER_ADDRESS, SERVER_PORT, } from '@sentry/conventions/attributes'; -import { DB_SYSTEM_NAME_VALUE_POSTGRESQL } from '@opentelemetry/semantic-conventions'; import { ATTR_DB_CLIENT_CONNECTION_POOL_NAME, ATTR_DB_CLIENT_CONNECTION_STATE, DB_CLIENT_CONNECTION_STATE_VALUE_USED, DB_CLIENT_CONNECTION_STATE_VALUE_IDLE, + DB_SYSTEM_NAME_VALUE_POSTGRESQL, DB_SYSTEM_VALUE_POSTGRESQL, ATTR_DB_CONNECTION_STRING, ATTR_NET_PEER_PORT, diff --git a/packages/node/src/integrations/tracing/postgresjs.ts b/packages/node/src/integrations/tracing/postgresjs.ts index 3e1ec964a42f..c5cf013ae5ec 100644 --- a/packages/node/src/integrations/tracing/postgresjs.ts +++ b/packages/node/src/integrations/tracing/postgresjs.ts @@ -8,7 +8,6 @@ import { safeExecuteInTheMiddle, } from '@opentelemetry/instrumentation'; import { InstrumentationNodeModuleFile } from './InstrumentationNodeModuleFile'; -import { ATTR_DB_RESPONSE_STATUS_CODE } 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 { @@ -25,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 = { diff --git a/packages/node/src/integrations/tracing/tedious/vendored/semconv.ts b/packages/node/src/integrations/tracing/tedious/vendored/semconv.ts index 2c21943eb34f..f336df59a16b 100644 --- a/packages/node/src/integrations/tracing/tedious/vendored/semconv.ts +++ b/packages/node/src/integrations/tracing/tedious/vendored/semconv.ts @@ -18,8 +18,6 @@ * * @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; @@ -29,8 +27,6 @@ export const ATTR_DB_SQL_TABLE = 'db.sql.table' as const; * * @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; @@ -40,8 +36,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; @@ -51,6 +45,5 @@ export const ATTR_NET_PEER_PORT = 'net.peer.port' as const; * * 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;