Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mattoberle committed Oct 20, 2021
1 parent 8538e80 commit c4e9be1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def _get_attributes_from_url(url):
def _get_attributes_from_cursor(vendor, cursor, attrs):
"""Attempt to set db connection attributes by introspecting the cursor."""
if vendor == "postgresql":
info = getattr(getattr(cursor, 'connection', None), 'info', None)
info = getattr(getattr(cursor, "connection", None), "info", None)
if not info:
return attrs

Expand All @@ -166,9 +166,9 @@ def _get_attributes_from_cursor(vendor, cursor, attrs):
attrs[SpanAttributes.NET_TRANSPORT] = NetTransportValues.UNIX.value
if info.port:
# postgresql enforces this pattern on all socket names
attrs[
SpanAttributes.NET_PEER_NAME
] = os.path.join(info.host, f'.s.PGSQL.{info.port}')
attrs[SpanAttributes.NET_PEER_NAME] = os.path.join(
info.host, f".s.PGSQL.{info.port}"
)
else:
attrs[
SpanAttributes.NET_TRANSPORT
Expand Down

0 comments on commit c4e9be1

Please sign in to comment.