File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,11 @@ def log_output(*args):
18
18
def init_logging (sampling_rate = 1.0 ):
19
19
# Enable logging to app insights if a connection string is provided
20
20
if 'APPLICATIONINSIGHTS_CONNECTION_STRING' in os .environ :
21
- inject_openai_api ()
22
-
23
21
connection_string = os .environ ['APPLICATIONINSIGHTS_CONNECTION_STRING' ]
24
- trace .set_tracer_provider (TracerProvider (sampler = ParentBasedTraceIdRatio (sampling_rate )))
25
- trace .get_tracer_provider ().add_span_processor (BatchSpanProcessor (AzureMonitorTraceExporter (connection_string = connection_string )))
22
+ if connection_string != "" :
23
+ inject_openai_api ()
24
+ trace .set_tracer_provider (TracerProvider (sampler = ParentBasedTraceIdRatio (sampling_rate )))
25
+ trace .get_tracer_provider ().add_span_processor (BatchSpanProcessor (AzureMonitorTraceExporter (connection_string = connection_string )))
26
26
27
27
# Enable logging locally if the below variable is set
28
28
if 'PROMPTFLOW_TRACING_SERVER' in os .environ and os .environ ['PROMPTFLOW_TRACING_SERVER' ] != 'false' :
You can’t perform that action at this time.
0 commit comments