Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions src/backend/app_kernel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# app_kernel.py
import asyncio
import logging
import os
import uuid
from typing import Dict, List, Optional

Expand All @@ -9,6 +10,7 @@
from auth.auth_utils import get_authenticated_user_details

# Azure monitoring
from azure.monitor.opentelemetry import configure_azure_monitor
from config_kernel import Config
from event_utils import track_event_if_configured

Expand All @@ -32,19 +34,19 @@
# Updated import for KernelArguments
from utils_kernel import initialize_runtime_and_context, rai_success

# # Check if the Application Insights Instrumentation Key is set in the environment variables
# connection_string = os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING")
# if connection_string:
# # Configure Application Insights if the Instrumentation Key is found
# configure_azure_monitor(connection_string=connection_string)
# logging.info(
# "Application Insights configured with the provided Instrumentation Key"
# )
# else:
# # Log a warning if the Instrumentation Key is not found
# logging.warning(
# "No Application Insights Instrumentation Key found. Skipping configuration"
# )
# Check if the Application Insights Instrumentation Key is set in the environment variables
connection_string = os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING")
if connection_string:
# Configure Application Insights if the Instrumentation Key is found
configure_azure_monitor(connection_string=connection_string)
logging.info(
"Application Insights configured with the provided Instrumentation Key"
)
else:
# Log a warning if the Instrumentation Key is not found
logging.warning(
"No Application Insights Instrumentation Key found. Skipping configuration"
)

# Configure logging
logging.basicConfig(level=logging.INFO)
Expand Down
Loading