@@ -368,14 +368,8 @@ def initialize_telemetry_client(
368
368
try :
369
369
370
370
with TelemetryClientFactory ._lock :
371
-
372
371
TelemetryClientFactory ._initialize ()
373
372
if session_id_hex not in TelemetryClientFactory ._clients :
374
- logger .debug (
375
- "Session ID not in clients: %s" ,
376
- session_id_hex ,
377
- flush = True ,
378
- )
379
373
logger .debug (
380
374
"Creating new TelemetryClient for connection %s" ,
381
375
session_id_hex ,
@@ -391,13 +385,9 @@ def initialize_telemetry_client(
391
385
executor = TelemetryClientFactory ._executor ,
392
386
)
393
387
else :
394
- logger .debug ("Telemetry disabled: %s" , session_id_hex )
395
388
TelemetryClientFactory ._clients [
396
389
session_id_hex
397
390
] = NoopTelemetryClient ()
398
- logger .debug (
399
- "Noop Telemetry client initialized: %s" , session_id_hex
400
- )
401
391
402
392
except Exception as e :
403
393
logger .debug ("Failed to initialize telemetry client: %s" , e )
@@ -423,6 +413,7 @@ def get_telemetry_client(session_id_hex):
423
413
@staticmethod
424
414
def close (session_id_hex ):
425
415
"""Close and remove the telemetry client for a specific connection"""
416
+
426
417
with TelemetryClientFactory ._lock :
427
418
if (
428
419
telemetry_client := TelemetryClientFactory ._clients .pop (
@@ -432,7 +423,6 @@ def close(session_id_hex):
432
423
logger .debug (
433
424
"Removing telemetry client for connection %s" , session_id_hex
434
425
)
435
- telemetry_client = TelemetryClientFactory ._clients .pop (session_id_hex )
436
426
telemetry_client .close ()
437
427
438
428
# Shutdown executor if no more clients
0 commit comments