File tree Expand file tree Collapse file tree 1 file changed +15
-13
lines changed
Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Original file line number Diff line number Diff line change 11# app_kernel.py
22import asyncio
33import logging
4+ import os
45import uuid
56from typing import Dict , List , Optional
67
910from auth .auth_utils import get_authenticated_user_details
1011
1112# Azure monitoring
13+ from azure .monitor .opentelemetry import configure_azure_monitor
1214from config_kernel import Config
1315from event_utils import track_event_if_configured
1416
3234# Updated import for KernelArguments
3335from utils_kernel import initialize_runtime_and_context , rai_success
3436
35- # # Check if the Application Insights Instrumentation Key is set in the environment variables
36- # connection_string = os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING")
37- # if connection_string:
38- # # Configure Application Insights if the Instrumentation Key is found
39- # configure_azure_monitor(connection_string=connection_string)
40- # logging.info(
41- # "Application Insights configured with the provided Instrumentation Key"
42- # )
43- # else:
44- # # Log a warning if the Instrumentation Key is not found
45- # logging.warning(
46- # "No Application Insights Instrumentation Key found. Skipping configuration"
47- # )
37+ # Check if the Application Insights Instrumentation Key is set in the environment variables
38+ connection_string = os .getenv ("APPLICATIONINSIGHTS_CONNECTION_STRING" )
39+ if connection_string :
40+ # Configure Application Insights if the Instrumentation Key is found
41+ configure_azure_monitor (connection_string = connection_string )
42+ logging .info (
43+ "Application Insights configured with the provided Instrumentation Key"
44+ )
45+ else :
46+ # Log a warning if the Instrumentation Key is not found
47+ logging .warning (
48+ "No Application Insights Instrumentation Key found. Skipping configuration"
49+ )
4850
4951# Configure logging
5052logging .basicConfig (level = logging .INFO )
You can’t perform that action at this time.
0 commit comments