Skip to content

Commit 4521720

Browse files
authored
[EventHubs/ServiceBus] update network trace params to use empty strings not None (#34458)
* update network trace params * update network trace params eh * update changelog
1 parent 7c43327 commit 4521720

File tree

18 files changed

+27
-22
lines changed

18 files changed

+27
-22
lines changed

sdk/eventhub/azure-eventhub/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@
1010

1111
### Other Changes
1212

13+
- Updated network trace logging to replace `None` values in AMQP connection info with empty strings as per the OpenTelemetry specification.
14+
1315
## 5.11.6 (2024-02-12)
1416

1517
This version and all future versions will require Python 3.8+. Python 3.7 is no longer supported.
1618

1719
### Features Added
20+
1821
- Added `keep_alive` functionality on EventHubProducerClient to allow for long-living producers. [#33726](https://github.com/Azure/azure-sdk-for-python/issues/33726)
1922

2023
### Other Changes
24+
2125
- Added support for Python 3.12.
2226

2327
## 5.11.5 (2023-11-13)

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/_connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def __init__( # pylint:disable=too-many-locals,too-many-statements
135135
custom_endpoint = f"{custom_parsed_url.hostname}:{custom_port}{custom_parsed_url.path}"
136136
self._container_id = container_id or str(uuid.uuid4())
137137
self._network_trace = network_trace
138-
self._network_trace_params = {"amqpConnection": self._container_id, "amqpSession": None, "amqpLink": None}
138+
self._network_trace_params = {"amqpConnection": self._container_id, "amqpSession": "", "amqpLink": ""}
139139

140140
transport = kwargs.get("transport")
141141
self._transport_type = transport_type

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_cbs_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def __init__(
6363
self._network_trace_params = {
6464
"amqpConnection": self._session._connection._container_id,
6565
"amqpSession": self._session.name,
66-
"amqpLink": None
66+
"amqpLink": ""
6767
}
6868

6969
self._token_status_code: Optional[int] = None

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_client_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,8 @@ async def close_async(self):
304304
if self._keep_alive_thread:
305305
await self._keep_alive_thread
306306
self._keep_alive_thread = None
307-
self._network_trace_params["amqpConnection"] = None
308-
self._network_trace_params["amqpSession"] = None
307+
self._network_trace_params["amqpConnection"] = ""
308+
self._network_trace_params["amqpSession"] = ""
309309

310310
async def auth_complete_async(self):
311311
"""Whether the authentication handshake is complete during

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_connection_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def __init__(# pylint:disable=too-many-locals,too-many-statements
116116
custom_endpoint = f"{custom_parsed_url.hostname}:{custom_port}{custom_parsed_url.path}"
117117
self._container_id: str = container_id or str(uuid.uuid4())
118118
self._network_trace = network_trace
119-
self._network_trace_params = {"amqpConnection": self._container_id, "amqpSession": None, "amqpLink": None}
119+
self._network_trace_params = {"amqpConnection": self._container_id, "amqpSession": "", "amqpLink": ""}
120120

121121
transport = kwargs.get("transport")
122122
self._transport_type = transport_type

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_management_operation_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(self, session, endpoint='$management', **kwargs):
3131
self._network_trace_params = {
3232
"amqpConnection": self._session._connection._container_id,
3333
"amqpSession": self._session.name,
34-
"amqpLink": None
34+
"amqpLink": ""
3535
}
3636
self._mgmt_link: ManagementLink = self._session.create_request_response_link_pair(
3737
endpoint=endpoint,

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/cbs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def __init__(
8181
self._network_trace_params = {
8282
"amqpConnection": self._session._connection._container_id,
8383
"amqpSession": self._session.name,
84-
"amqpLink": None
84+
"amqpLink": ""
8585
}
8686

8787
self._token_status_code: Optional[int] = None

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def __init__(self, hostname, **kwargs):
181181
"remote_idle_timeout_empty_frame_send_ratio", None
182182
)
183183
self._network_trace = kwargs.pop("network_trace", False)
184-
self._network_trace_params = {"amqpConnection": None, "amqpSession": None, "amqpLink": None}
184+
self._network_trace_params = {"amqpConnection": "", "amqpSession": "", "amqpLink": ""}
185185

186186
# Session settings
187187
self._outgoing_window = kwargs.pop("outgoing_window", OUTGOING_WINDOW)
@@ -377,8 +377,8 @@ def close(self):
377377
except RuntimeError: # Probably thread failed to start in .open()
378378
logging.debug("Keep alive thread failed to join.", exc_info=True)
379379
self._keep_alive_thread = None
380-
self._network_trace_params["amqpConnection"] = None
381-
self._network_trace_params["amqpSession"] = None
380+
self._network_trace_params["amqpConnection"] = ""
381+
self._network_trace_params["amqpSession"] = ""
382382

383383
def auth_complete(self):
384384
"""Whether the authentication handshake is complete during

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/management_operation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(self, session, endpoint='$management', **kwargs):
3131
self._network_trace_params = {
3232
"amqpConnection": self._session._connection._container_id,
3333
"amqpSession": self._session.name,
34-
"amqpLink": None
34+
"amqpLink": ""
3535
}
3636
self._mgmt_link: ManagementLink = self._session.create_request_response_link_pair(
3737
endpoint=endpoint,

sdk/servicebus/azure-servicebus/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
### Other Changes
1212

1313
- Updated minimum `azure-core` version to 1.28.0.
14+
- Updated network trace logging to replace `None` values in AMQP connection info with empty strings as per the OpenTelemetry specification ([#32190](https://github.com/Azure/azure-sdk-for-python/issues/32190)).
1415

1516
## 7.11.4 (2023-11-13)
1617

0 commit comments

Comments
 (0)