Skip to content

Commit 7494e38

Browse files
chore: remove event_utils changes from PR
1 parent 2d6e64a commit 7494e38

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

src/backend/event_utils.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
import os
21
import logging
2+
import os
33
from azure.monitor.events.extension import track_event
44

5-
logger = logging.getLogger(__name__)
6-
_telemetry_disabled_logged = False
7-
85

96
def track_event_if_configured(event_name: str, event_data: dict):
10-
global _telemetry_disabled_logged
117
connection_string = os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING")
12-
if not connection_string:
13-
if not _telemetry_disabled_logged:
14-
logger.warning("Application Insights connection string is not set; telemetry events are disabled.")
15-
_telemetry_disabled_logged = True
16-
return
17-
18-
track_event(event_name, event_data)
8+
if connection_string:
9+
track_event(event_name, event_data)
10+
else:
11+
logging.warning(f"Skipping track_event for {event_name} as Application Insights is not configured")

0 commit comments

Comments
 (0)