File tree Expand file tree Collapse file tree 4 files changed +14
-12
lines changed
Expand file tree Collapse file tree 4 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ def configure(
6969 auto_start_session : Optional [bool ] = None ,
7070 skip_auto_end_session : Optional [bool ] = None ,
7171 env_data_opt_out : Optional [bool ] = None ,
72+ otel : Optional [OTELConfig ] = None ,
7273 ):
7374 if self .has_sessions :
7475 return logger .warning (
@@ -87,6 +88,7 @@ def configure(
8788 auto_start_session = auto_start_session ,
8889 skip_auto_end_session = skip_auto_end_session ,
8990 env_data_opt_out = env_data_opt_out ,
91+ telemetry = otel ,
9092 )
9193
9294 def initialize (self ) -> Union [Session , None ]:
@@ -107,7 +109,7 @@ def initialize(self) -> Union[Session, None]:
107109 self ._llm_tracker .override_api ()
108110
109111 # Initialize telemetry with configuration
110- self .telemetry .initialize (self ._config .otel )
112+ self .telemetry .initialize (self ._config .telemetry )
111113
112114 session = None
113115 if self ._config .auto_start_session :
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ def __init__(self):
1717 self .auto_start_session : bool = True
1818 self .skip_auto_end_session : bool = False
1919 self .env_data_opt_out : bool = False
20- self .otel : OTELConfig = OTELConfig () # Default OTEL configuration
20+ self .telemetry : OTELConfig = OTELConfig () # Default OTEL configuration
2121
2222 def configure (
2323 self ,
@@ -32,7 +32,7 @@ def configure(
3232 auto_start_session : Optional [bool ] = None ,
3333 skip_auto_end_session : Optional [bool ] = None ,
3434 env_data_opt_out : Optional [bool ] = None ,
35- otel : Optional [OTELConfig ] = None , # New parameter
35+ telemetry : Optional [OTELConfig ] = None , # New parameter
3636 ):
3737 if api_key is not None :
3838 try :
@@ -77,5 +77,5 @@ def configure(
7777 self .env_data_opt_out = env_data_opt_out
7878
7979 # OTEL configuration
80- if otel is not None :
81- self .otel = otel
80+ if telemetry is not None :
81+ self .telemetry = telemetry
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ def __init__(self):
2626 self ._session_exporters : Dict [UUID , ExportManager ] = {}
2727 self .config : Optional [OTELConfig ] = None
2828
29- def initialize (self , config : Configuration ) -> None :
29+ def initialize (self , config : OTELConfig ) -> None :
3030 """Initialize telemetry components"""
3131 # Check for environment variables if no exporters configured
3232 if not config .otel .additional_exporters :
Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ def test_configuration_with_otel():
1313 otel_config = OTELConfig (additional_exporters = [exporter ])
1414
1515 config = Configuration ()
16- config .configure (None , otel = otel_config )
16+ config .configure (None , telemetry = otel_config )
1717
18- assert config .otel == otel_config
19- assert config .otel .additional_exporters == [exporter ]
18+ assert config .telemetry == otel_config
19+ assert config .telemetry .additional_exporters == [exporter ]
2020
2121
2222def test_init_accepts_telemetry_config ():
@@ -75,7 +75,7 @@ def test_multiple_exporters_in_config():
7575
7676 telemetry = OTELConfig (additional_exporters = [exporter1 , exporter2 ])
7777 config = Configuration ()
78- config .configure (None , otel = telemetry )
78+ config .configure (None , telemetry = telemetry )
7979
80- assert len (config .otel .additional_exporters ) == 2
81- assert config .otel .additional_exporters == [exporter1 , exporter2 ]
80+ assert len (config .telemetry .additional_exporters ) == 2
81+ assert config .telemetry .additional_exporters == [exporter1 , exporter2 ]
You can’t perform that action at this time.
0 commit comments