Skip to content

Commit

Permalink
Remove db.name attribute from Redis instrumentation (#1427)
Browse files Browse the repository at this point in the history
  • Loading branch information
luke6Lh43 committed Nov 10, 2022
1 parent 7acc336 commit 5f85a5b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#1424](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1424))
- `opentelemetry-instrumentation-dbapi` Fix the check for the connection already being instrumented in instrument_connection().
([#1424](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1424))
- Remove db.name attribute from Redis instrumentation
([#1427](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1427))

## Version 1.14.0/0.35b0 (2022-11-03)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def _extract_conn_attributes(conn_kwargs):
SpanAttributes.DB_SYSTEM: DbSystemValues.REDIS.value,
}
db = conn_kwargs.get("db", 0)
attributes[SpanAttributes.DB_NAME] = db
attributes[SpanAttributes.DB_REDIS_DATABASE_INDEX] = db
try:
attributes[SpanAttributes.NET_PEER_NAME] = conn_kwargs.get(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ def tearDown(self):
def _check_span(self, span, name):
self.assertEqual(span.name, name)
self.assertIs(span.status.status_code, trace.StatusCode.UNSET)
self.assertEqual(span.attributes.get(SpanAttributes.DB_NAME), 0)
self.assertEqual(
span.attributes.get(SpanAttributes.DB_REDIS_DATABASE_INDEX), 0
)
self.assertEqual(
span.attributes[SpanAttributes.NET_PEER_NAME], "localhost"
)
Expand Down Expand Up @@ -209,7 +211,9 @@ def tearDown(self):
def _check_span(self, span, name):
self.assertEqual(span.name, name)
self.assertIs(span.status.status_code, trace.StatusCode.UNSET)
self.assertEqual(span.attributes.get(SpanAttributes.DB_NAME), 0)
self.assertEqual(
span.attributes.get(SpanAttributes.DB_REDIS_DATABASE_INDEX), 0
)
self.assertEqual(
span.attributes[SpanAttributes.NET_PEER_NAME], "localhost"
)
Expand Down

0 comments on commit 5f85a5b

Please sign in to comment.