|
1 | 1 | # app_kernel.py |
2 | 2 | import asyncio |
3 | 3 | import logging |
4 | | -import os |
5 | 4 | import uuid |
6 | 5 | from typing import Dict, List, Optional |
7 | 6 |
|
|
10 | 9 | from auth.auth_utils import get_authenticated_user_details |
11 | 10 |
|
12 | 11 | # Azure monitoring |
13 | | -from azure.monitor.opentelemetry import configure_azure_monitor |
| 12 | +# from azure.monitor.opentelemetry import configure_azure_monitor |
14 | 13 | from config_kernel import Config |
15 | 14 | from event_utils import track_event_if_configured |
16 | 15 |
|
|
35 | 34 | from utils_kernel import initialize_runtime_and_context, rai_success |
36 | 35 |
|
37 | 36 | # 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 | | -# ) |
| 37 | +# connection_string = os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING") |
| 38 | +# if connection_string: |
| 39 | +# # Configure Application Insights if the Instrumentation Key is found |
| 40 | +# configure_azure_monitor(connection_string=connection_string) |
| 41 | +# logging.info( |
| 42 | +# "Application Insights configured with the provided Instrumentation Key" |
| 43 | +# ) |
| 44 | +# else: |
| 45 | +# # Log a warning if the Instrumentation Key is not found |
| 46 | +# logging.warning( |
| 47 | +# "No Application Insights Instrumentation Key found. Skipping configuration" |
| 48 | +# ) |
50 | 49 |
|
51 | 50 | # Configure logging |
52 | 51 | logging.basicConfig(level=logging.INFO) |
53 | 52 |
|
| 53 | + |
54 | 54 | # Suppress INFO logs from 'azure.core.pipeline.policies.http_logging_policy' |
55 | 55 | logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel( |
56 | 56 | logging.WARNING |
|
0 commit comments