From de9e64eb3ab1d030e22a8325ca9d36c1aa8d8353 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 24 Jan 2025 12:14:15 +0530 Subject: [PATCH 1/2] fix: operation id issue on server --- src/backend/agents/group_chat_manager.py | 4 ++-- src/backend/app.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backend/agents/group_chat_manager.py b/src/backend/agents/group_chat_manager.py index e4a36aab5..9300367f9 100644 --- a/src/backend/agents/group_chat_manager.py +++ b/src/backend/agents/group_chat_manager.py @@ -305,12 +305,12 @@ async def _execute_step(self, session_id: str, step: Step): ) track_event( - f"Group Chat Manager - Requesting {step.agent.value.title()} to perform the action and added into the cosmos", + f"Group Chat Manager - Requesting {formatted_agent} to perform the action and added into the cosmos", { "session_id": session_id, "user_id": self._user_id, "plan_id": step.plan_id, - "content": f"Requesting {step.agent.value.title()} to perform action: {step.action}", + "content": f"Requesting {formatted_agent} to perform action: {step.action}", "source": "GroupChatManager", "step_id": step.id, }, diff --git a/src/backend/app.py b/src/backend/app.py index eea1e5d02..9ff564c8e 100644 --- a/src/backend/app.py +++ b/src/backend/app.py @@ -23,6 +23,7 @@ from fastapi.middleware.cors import CORSMiddleware from azure.monitor.opentelemetry import configure_azure_monitor from azure.monitor.events.extension import track_event +from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor configure_azure_monitor( connection_string=os.getenv("APPLICATIONINSIGHTS_INSTRUMENTATION_KEY") @@ -45,6 +46,8 @@ # Initialize the FastAPI app app = FastAPI() +FastAPIInstrumentor.instrument_app(app) + frontend_url = Config.FRONTEND_SITE_NAME # Add this near the top of your app.py, after initializing the app From e271e8d16c36f33cd7c089cf44b75dd17afa731e Mon Sep 17 00:00:00 2001 From: Roopan P M Date: Wed, 29 Jan 2025 23:28:19 +0530 Subject: [PATCH 2/2] lint issue fixed --- src/backend/agents/group_chat_manager.py | 1 - src/backend/app.py | 1 - 2 files changed, 2 deletions(-) diff --git a/src/backend/agents/group_chat_manager.py b/src/backend/agents/group_chat_manager.py index 0809edc08..3591f0ef9 100644 --- a/src/backend/agents/group_chat_manager.py +++ b/src/backend/agents/group_chat_manager.py @@ -304,7 +304,6 @@ async def _execute_step(self, session_id: str, step: Step): ) ) - track_event_if_configured( f"Group Chat Manager - Requesting {formatted_agent} to perform the action and added into the cosmos", { diff --git a/src/backend/app.py b/src/backend/app.py index 5b8844145..1e96822dc 100644 --- a/src/backend/app.py +++ b/src/backend/app.py @@ -23,7 +23,6 @@ from event_utils import track_event_if_configured from fastapi.middleware.cors import CORSMiddleware from azure.monitor.opentelemetry import configure_azure_monitor -from azure.monitor.events.extension import track_event from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor