diff --git a/sdk/servicebus/azure-servicebus/CHANGELOG.md b/sdk/servicebus/azure-servicebus/CHANGELOG.md index 89eca51ad764..957fa9ac5c98 100644 --- a/sdk/servicebus/azure-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-servicebus/CHANGELOG.md @@ -7,6 +7,7 @@ ### Breaking Changes ### Bugs Fixed +- Fixed a bug where asynchronous method to add distributed tracing attributes was not being awaited (Issue #28738). ### Other Changes diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_base_handler_async.py b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_base_handler_async.py index 328c69c881ab..284f41afed47 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_base_handler_async.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_base_handler_async.py @@ -387,7 +387,7 @@ async def _mgmt_request_response_with_retry( **kwargs ) - async def _add_span_request_attributes(self, span): + def _add_span_request_attributes(self, span): return BaseHandlerSync._add_span_request_attributes( # pylint: disable=protected-access self, span ) diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_sender_async.py b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_sender_async.py index ccbdd6e4ab20..b1d43f0f2a7a 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_sender_async.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_sender_async.py @@ -257,7 +257,7 @@ async def schedule_messages( schedule_time_utc, send_span, *obj_messages ) if send_span: - await self._add_span_request_attributes(send_span) + self._add_span_request_attributes(send_span) return await self._mgmt_request_response_with_retry( REQUEST_RESPONSE_SCHEDULE_MESSAGE_OPERATION, request_body, @@ -375,7 +375,7 @@ async def send_messages( return # Short circuit noop if an empty list or batch is provided. if send_span: - await self._add_span_request_attributes(send_span) + self._add_span_request_attributes(send_span) await self._do_retryable_operation( self._send,