Skip to content

Commit

Permalink
Fix socket
Browse files Browse the repository at this point in the history
  • Loading branch information
sl0thentr0py committed Nov 22, 2024
1 parent 4c07934 commit df9c531
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion sentry_sdk/integrations/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ def create_connection(
origin=SocketIntegration.origin,
only_if_parent=True,
) as span:
span.set_data("address", address)
host, port = address
span.set_data("address.host", host)
span.set_data("address.port", port)
span.set_data("timeout", timeout)
span.set_data("source_address", source_address)

Expand Down
4 changes: 2 additions & 2 deletions tests/integrations/socket/test_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def test_create_connection_trace(sentry_init, capture_events):
assert connect_span["description"] == "example.com:443"
assert connect_span["data"] == ApproxDict(
{
"address": ["example.com", 443],
"address.host": "example.com",
"address.port": 443,
"timeout": timeout,
"source_address": None,
}
)

Expand Down

0 comments on commit df9c531

Please sign in to comment.