Skip to content

Commit

Permalink
fix!(mysql*,redis): net.peer.ip -> db.connection_string (#913)
Browse files Browse the repository at this point in the history
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
  • Loading branch information
trask and Flarna committed Feb 24, 2022
1 parent 760c4d4 commit bf39b90
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Expand Up @@ -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,
};
Expand Down
Expand Up @@ -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,
};
Expand Down
Expand Up @@ -120,7 +120,7 @@ export const getTracedInternalSendCommand = (
}
if (this.address) {
span.setAttribute(
SemanticAttributes.NET_PEER_IP,
SemanticAttributes.DB_CONNECTION_STRING,
`redis://${this.address}`
);
}
Expand Down
Expand Up @@ -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 = {
Expand Down

0 comments on commit bf39b90

Please sign in to comment.