diff --git a/plugins/node/opentelemetry-instrumentation-mysql/src/utils.ts b/plugins/node/opentelemetry-instrumentation-mysql/src/utils.ts index b89d19e9a6..90b07bea4f 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql/src/utils.ts +++ b/plugins/node/opentelemetry-instrumentation-mysql/src/utils.ts @@ -36,7 +36,11 @@ export function getConnectionAttributes( return { [SemanticAttributes.NET_PEER_NAME]: host, [SemanticAttributes.NET_PEER_PORT]: port, - [SemanticAttributes.NET_PEER_IP]: getJDBCString(host, port, database), + [SemanticAttributes.DB_CONNECTION_STRING]: getJDBCString( + host, + port, + database + ), [SemanticAttributes.DB_NAME]: database, [SemanticAttributes.DB_USER]: user, }; diff --git a/plugins/node/opentelemetry-instrumentation-mysql2/src/utils.ts b/plugins/node/opentelemetry-instrumentation-mysql2/src/utils.ts index b6ab662be2..a71560014e 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql2/src/utils.ts +++ b/plugins/node/opentelemetry-instrumentation-mysql2/src/utils.ts @@ -36,7 +36,11 @@ export function getConnectionAttributes(config: Config): SpanAttributes { return { [SemanticAttributes.NET_PEER_NAME]: host, [SemanticAttributes.NET_PEER_PORT]: port, - [SemanticAttributes.NET_PEER_IP]: getJDBCString(host, port, database), + [SemanticAttributes.DB_CONNECTION_STRING]: getJDBCString( + host, + port, + database + ), [SemanticAttributes.DB_NAME]: database, [SemanticAttributes.DB_USER]: user, }; diff --git a/plugins/node/opentelemetry-instrumentation-redis/src/utils.ts b/plugins/node/opentelemetry-instrumentation-redis/src/utils.ts index 471e288dbc..2e8aaa944a 100644 --- a/plugins/node/opentelemetry-instrumentation-redis/src/utils.ts +++ b/plugins/node/opentelemetry-instrumentation-redis/src/utils.ts @@ -120,7 +120,7 @@ export const getTracedInternalSendCommand = ( } if (this.address) { span.setAttribute( - SemanticAttributes.NET_PEER_IP, + SemanticAttributes.DB_CONNECTION_STRING, `redis://${this.address}` ); } diff --git a/plugins/node/opentelemetry-instrumentation-redis/test/redis.test.ts b/plugins/node/opentelemetry-instrumentation-redis/test/redis.test.ts index 9728e05b12..a5f491520d 100644 --- a/plugins/node/opentelemetry-instrumentation-redis/test/redis.test.ts +++ b/plugins/node/opentelemetry-instrumentation-redis/test/redis.test.ts @@ -53,7 +53,7 @@ const DEFAULT_ATTRIBUTES = { [SemanticAttributes.DB_SYSTEM]: RedisInstrumentation.COMPONENT, [SemanticAttributes.NET_PEER_NAME]: CONFIG.host, [SemanticAttributes.NET_PEER_PORT]: CONFIG.port, - [SemanticAttributes.NET_PEER_IP]: URL, + [SemanticAttributes.DB_CONNECTION_STRING]: URL, }; const unsetStatus: SpanStatus = {