@@ -172,7 +172,7 @@ def __init__(
172172 host_url ,
173173 executor ,
174174 batch_size ,
175- http_client ,
175+ client_context ,
176176 ):
177177 logger .debug ("Initializing TelemetryClient for connection: %s" , session_id_hex )
178178 self ._telemetry_enabled = telemetry_enabled
@@ -186,8 +186,8 @@ def __init__(
186186 self ._host_url = host_url
187187 self ._executor = executor
188188
189- # Use the provided HTTP client directly
190- self ._http_client = http_client
189+ # Create own HTTP client from client context
190+ self ._http_client = UnifiedHttpClient ( client_context )
191191
192192 def _export_event (self , event ):
193193 """Add an event to the batch queue and flush if batch is full"""
@@ -456,7 +456,7 @@ def initialize_telemetry_client(
456456 auth_provider ,
457457 host_url ,
458458 batch_size ,
459- http_client ,
459+ client_context ,
460460 ):
461461 """Initialize a telemetry client for a specific connection if telemetry is enabled"""
462462 try :
@@ -479,7 +479,7 @@ def initialize_telemetry_client(
479479 host_url = host_url ,
480480 executor = TelemetryClientFactory ._executor ,
481481 batch_size = batch_size ,
482- http_client = http_client ,
482+ client_context = client_context ,
483483 )
484484 else :
485485 TelemetryClientFactory ._clients [
@@ -532,10 +532,10 @@ def connection_failure_log(
532532 host_url : str ,
533533 http_path : str ,
534534 port : int ,
535- http_client ,
535+ client_context ,
536536 user_agent : Optional [str ] = None ,
537537 ):
538- """Send error telemetry when connection creation fails, using existing HTTP client"""
538+ """Send error telemetry when connection creation fails, using provided client context """
539539
540540 UNAUTH_DUMMY_SESSION_ID = "unauth_session_id"
541541
@@ -545,7 +545,7 @@ def connection_failure_log(
545545 auth_provider = None ,
546546 host_url = host_url ,
547547 batch_size = TelemetryClientFactory .DEFAULT_BATCH_SIZE ,
548- http_client = http_client ,
548+ client_context = client_context ,
549549 )
550550
551551 telemetry_client = TelemetryClientFactory .get_telemetry_client (
0 commit comments