8000 Fix socket (#3819) · getsentry/sentry-python@10bc3fa · GitHub
[go: up one dir, main page]

Skip to content

Commit 10bc3fa

Browse files
authored
Fix socket (#3819)
1 parent 4c07934 commit 10bc3fa

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

sentry_sdk/integrations/socket.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ def create_connection(
5959
origin=SocketIntegration.origin,
6060
only_if_parent=True,
6161
) as span:
62-
span.set_data("address", address)
62+
host, port = address
63+
span.set_data("address.host", host)
64+
span.set_data("address.port", port)
6365
span.set_data("timeout", timeout)
6466
span.set_data("source_address", source_address)
6567

tests/integrations/socket/test_socket.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ def test_create_connection_trace(sentry_init, capture_events):
4242
assert connect_span["description"] == "example.com:443"
4343
assert connect_span["data"] == ApproxDict(
4444
{
45-
"address": ["example.com", 443],
45+
"address.host": "example.com",
46+
"address.port": 443,
4647
"timeout": timeout,
47-
"source_address": None,
4848
}
4949
)
5050

0 commit comments

Comments
 (0)
0