diff --git a/src/api/auth.py b/src/api/auth.py index bc2353df..5432335a 100644 --- a/src/api/auth.py +++ b/src/api/auth.py @@ -41,11 +41,11 @@ async def auth_callback(request: Request, auth_service, session_manager): connection_id, authorization_code, state, request ) - await TelemetryClient.send_event(Category.AUTHENTICATION, MessageId.ORBTA0063I) + await TelemetryClient.send_event(Category.AUTHENTICATION, MessageId.ORB_AUTH_OAUTH_CALLBACK) # If this is app auth, set JWT cookie if result.get("purpose") == "app_auth" and result.get("jwt_token"): - await TelemetryClient.send_event(Category.AUTHENTICATION, MessageId.ORBTA0060I) + await TelemetryClient.send_event(Category.AUTHENTICATION, MessageId.ORB_AUTH_SUCCESS) response = JSONResponse( {k: v for k, v in result.items() if k != "jwt_token"} ) @@ -65,7 +65,7 @@ async def auth_callback(request: Request, auth_service, session_manager): import traceback traceback.print_exc() - await TelemetryClient.send_event(Category.AUTHENTICATION, MessageId.ORBTA0064E) + await TelemetryClient.send_event(Category.AUTHENTICATION, MessageId.ORB_AUTH_OAUTH_FAILED) return JSONResponse({"error": f"Callback failed: {str(e)}"}, status_code=500) @@ -77,7 +77,7 @@ async def auth_me(request: Request, auth_service, session_manager): async def auth_logout(request: Request, auth_service, session_manager): """Logout user by clearing auth cookie""" - await TelemetryClient.send_event(Category.AUTHENTICATION, MessageId.ORBTA0062I) + await TelemetryClient.send_event(Category.AUTHENTICATION, MessageId.ORB_AUTH_LOGOUT) response = JSONResponse( {"status": "logged_out", "message": "Successfully logged out"} ) diff --git a/src/api/connectors.py b/src/api/connectors.py index 6ab25b5e..541ebd51 100644 --- a/src/api/connectors.py +++ b/src/api/connectors.py @@ -26,7 +26,7 @@ async def connector_sync(request: Request, connector_service, session_manager): selected_files = data.get("selected_files") try: - await TelemetryClient.send_event(Category.CONNECTOR_OPERATIONS, MessageId.ORBTA0072I) + await TelemetryClient.send_event(Category.CONNECTOR_OPERATIONS, MessageId.ORB_CONN_SYNC_START) logger.debug( "Starting connector sync", connector_type=connector_type, @@ -104,7 +104,7 @@ async def connector_sync(request: Request, connector_service, session_manager): jwt_token=jwt_token, ) task_ids = [task_id] - await TelemetryClient.send_event(Category.CONNECTOR_OPERATIONS, MessageId.ORBTA0073I) + await TelemetryClient.send_event(Category.CONNECTOR_OPERATIONS, MessageId.ORB_CONN_SYNC_COMPLETE) return JSONResponse( { "task_ids": task_ids, @@ -117,7 +117,7 @@ async def connector_sync(request: Request, connector_service, session_manager): except Exception as e: logger.error("Connector sync failed", error=str(e)) - await TelemetryClient.send_event(Category.CONNECTOR_OPERATIONS, MessageId.ORBTA0074E) + await TelemetryClient.send_event(Category.CONNECTOR_OPERATIONS, MessageId.ORB_CONN_SYNC_FAILED) return JSONResponse({"error": f"Sync failed: {str(e)}"}, status_code=500) @@ -189,7 +189,7 @@ async def connector_webhook(request: Request, connector_service, session_manager config=temp_config, ) try: - await TelemetryClient.send_event(Category.CONNECTOR_OPERATIONS, MessageId.ORBTA0075I) + await TelemetryClient.send_event(Category.CONNECTOR_OPERATIONS, MessageId.ORB_CONN_WEBHOOK_RECV) temp_connector = connector_service.connection_manager._create_connector( temp_connection ) @@ -341,7 +341,7 @@ async def connector_webhook(request: Request, connector_service, session_manager except Exception as e: logger.error("Webhook processing failed", error=str(e)) - await TelemetryClient.send_event(Category.CONNECTOR_OPERATIONS, MessageId.ORBTA0076E) + await TelemetryClient.send_event(Category.CONNECTOR_OPERATIONS, MessageId.ORB_CONN_WEBHOOK_FAILED) return JSONResponse( {"error": f"Webhook processing failed: {str(e)}"}, status_code=500 ) diff --git a/src/api/settings.py b/src/api/settings.py index 150b6749..bfa493d9 100644 --- a/src/api/settings.py +++ b/src/api/settings.py @@ -415,7 +415,7 @@ async def update_settings(request, session_manager): config_updated = True await TelemetryClient.send_event( Category.SETTINGS_OPERATIONS, - MessageId.ORBTA0123I + MessageId.ORB_SETTINGS_LLM_MODEL ) logger.info(f"LLM model changed from {old_model} to {body['llm_model']}") @@ -425,7 +425,7 @@ async def update_settings(request, session_manager): config_updated = True await TelemetryClient.send_event( Category.SETTINGS_OPERATIONS, - MessageId.ORBTA0122I + MessageId.ORB_SETTINGS_LLM_PROVIDER ) logger.info(f"LLM provider changed from {old_provider} to {body['llm_provider']}") @@ -434,7 +434,7 @@ async def update_settings(request, session_manager): config_updated = True await TelemetryClient.send_event( Category.SETTINGS_OPERATIONS, - MessageId.ORBTA0126I + MessageId.ORB_SETTINGS_SYSTEM_PROMPT ) # Also update the chat flow with the new system prompt @@ -454,7 +454,7 @@ async def update_settings(request, session_manager): config_updated = True await TelemetryClient.send_event( Category.SETTINGS_OPERATIONS, - MessageId.ORBTA0125I + MessageId.ORB_SETTINGS_EMBED_MODEL ) logger.info(f"Embedding model changed from {old_model} to {new_embedding_model}") @@ -464,7 +464,7 @@ async def update_settings(request, session_manager): config_updated = True await TelemetryClient.send_event( Category.SETTINGS_OPERATIONS, - MessageId.ORBTA0124I + MessageId.ORB_SETTINGS_EMBED_PROVIDER ) logger.info(f"Embedding provider changed from {old_provider} to {body['embedding_provider']}") @@ -473,7 +473,7 @@ async def update_settings(request, session_manager): config_updated = True await TelemetryClient.send_event( Category.SETTINGS_OPERATIONS, - MessageId.ORBTA0128I + MessageId.ORB_SETTINGS_DOCLING_UPDATED ) # Also update the flow with the new docling settings @@ -488,7 +488,7 @@ async def update_settings(request, session_manager): config_updated = True await TelemetryClient.send_event( Category.SETTINGS_OPERATIONS, - MessageId.ORBTA0128I + MessageId.ORB_SETTINGS_DOCLING_UPDATED ) # Also update the flow with the new docling settings @@ -503,7 +503,7 @@ async def update_settings(request, session_manager): config_updated = True await TelemetryClient.send_event( Category.SETTINGS_OPERATIONS, - MessageId.ORBTA0128I + MessageId.ORB_SETTINGS_DOCLING_UPDATED ) # Also update the flow with the new docling settings @@ -518,7 +518,7 @@ async def update_settings(request, session_manager): config_updated = True await TelemetryClient.send_event( Category.SETTINGS_OPERATIONS, - MessageId.ORBTA0127I + MessageId.ORB_SETTINGS_CHUNK_UPDATED ) # Also update the ingest flow with the new chunk size @@ -538,7 +538,7 @@ async def update_settings(request, session_manager): config_updated = True await TelemetryClient.send_event( Category.SETTINGS_OPERATIONS, - MessageId.ORBTA0127I + MessageId.ORB_SETTINGS_CHUNK_UPDATED ) # Also update the ingest flow with the new chunk overlap @@ -596,7 +596,7 @@ async def update_settings(request, session_manager): if provider_updated: await TelemetryClient.send_event( Category.SETTINGS_OPERATIONS, - MessageId.ORBTA0129I + MessageId.ORB_SETTINGS_PROVIDER_CREDS ) if not config_updated: @@ -641,7 +641,7 @@ async def update_settings(request, session_manager): ) await TelemetryClient.send_event( Category.SETTINGS_OPERATIONS, - MessageId.ORBTA0120I + MessageId.ORB_SETTINGS_UPDATED ) return JSONResponse({"message": "Configuration updated successfully"}) @@ -649,7 +649,7 @@ async def update_settings(request, session_manager): logger.error("Failed to update settings", error=str(e)) await TelemetryClient.send_event( Category.SETTINGS_OPERATIONS, - MessageId.ORBTA0121E + MessageId.ORB_SETTINGS_UPDATE_FAILED ) return JSONResponse( {"error": f"Failed to update settings: {str(e)}"}, status_code=500 @@ -659,7 +659,7 @@ async def update_settings(request, session_manager): async def onboarding(request, flows_service, session_manager=None): """Handle onboarding configuration setup""" try: - await TelemetryClient.send_event(Category.ONBOARDING, MessageId.ORBTA0130I) + await TelemetryClient.send_event(Category.ONBOARDING, MessageId.ORB_ONBOARD_START) # Get current configuration current_config = get_openrag_config() @@ -716,7 +716,7 @@ async def onboarding(request, flows_service, session_manager=None): config_updated = True await TelemetryClient.send_event( Category.ONBOARDING, - MessageId.ORBTA0134I, + MessageId.ORB_ONBOARD_LLM_MODEL, metadata={"llm_model": llm_model_selected} ) logger.info(f"LLM model selected during onboarding: {llm_model_selected}") @@ -740,7 +740,7 @@ async def onboarding(request, flows_service, session_manager=None): config_updated = True await TelemetryClient.send_event( Category.ONBOARDING, - MessageId.ORBTA0133I, + MessageId.ORB_ONBOARD_LLM_PROVIDER, metadata={"llm_provider": llm_provider_selected} ) logger.info(f"LLM provider selected during onboarding: {llm_provider_selected}") @@ -763,7 +763,7 @@ async def onboarding(request, flows_service, session_manager=None): config_updated = True await TelemetryClient.send_event( Category.ONBOARDING, - MessageId.ORBTA0136I, + MessageId.ORB_ONBOARD_EMBED_MODEL, metadata={"embedding_model": embedding_model_selected} ) logger.info(f"Embedding model selected during onboarding: {embedding_model_selected}") @@ -788,7 +788,7 @@ async def onboarding(request, flows_service, session_manager=None): config_updated = True await TelemetryClient.send_event( Category.ONBOARDING, - MessageId.ORBTA0135I, + MessageId.ORB_ONBOARD_EMBED_PROVIDER, metadata={"embedding_provider": embedding_provider_selected} ) logger.info(f"Embedding provider selected during onboarding: {embedding_provider_selected}") @@ -880,7 +880,7 @@ async def onboarding(request, flows_service, session_manager=None): if should_ingest_sample_data: await TelemetryClient.send_event( Category.ONBOARDING, - MessageId.ORBTA0137I + MessageId.ORB_ONBOARD_SAMPLE_DATA ) logger.info("Sample data ingestion requested during onboarding") @@ -1042,12 +1042,12 @@ async def onboarding(request, flows_service, session_manager=None): await TelemetryClient.send_event( Category.ONBOARDING, - MessageId.ORBTA0138I, + MessageId.ORB_ONBOARD_CONFIG_EDITED, metadata=onboarding_metadata ) await TelemetryClient.send_event( Category.ONBOARDING, - MessageId.ORBTA0131I, + MessageId.ORB_ONBOARD_COMPLETE, metadata=onboarding_metadata ) logger.info("Configuration marked as edited after onboarding") @@ -1055,7 +1055,7 @@ async def onboarding(request, flows_service, session_manager=None): else: await TelemetryClient.send_event( Category.ONBOARDING, - MessageId.ORBTA0132E + MessageId.ORB_ONBOARD_FAILED ) return JSONResponse( {"error": "Failed to save configuration"}, status_code=500 @@ -1073,7 +1073,7 @@ async def onboarding(request, flows_service, session_manager=None): logger.error("Failed to update onboarding settings", error=str(e)) await TelemetryClient.send_event( Category.ONBOARDING, - MessageId.ORBTA0132E + MessageId.ORB_ONBOARD_FAILED ) return JSONResponse( {"error": str(e)}, diff --git a/src/api/tasks.py b/src/api/tasks.py index 62430ec2..9ee30125 100644 --- a/src/api/tasks.py +++ b/src/api/tasks.py @@ -29,10 +29,10 @@ async def cancel_task(request: Request, task_service, session_manager): success = await task_service.cancel_task(user.user_id, task_id) if not success: - await TelemetryClient.send_event(Category.TASK_OPERATIONS, MessageId.ORBTA0094E) + await TelemetryClient.send_event(Category.TASK_OPERATIONS, MessageId.ORB_TASK_CANCEL_FAILED) return JSONResponse( {"error": "Task not found or cannot be cancelled"}, status_code=400 ) - await TelemetryClient.send_event(Category.TASK_OPERATIONS, MessageId.ORBTA0093I) + await TelemetryClient.send_event(Category.TASK_OPERATIONS, MessageId.ORB_TASK_CANCELLED) return JSONResponse({"status": "cancelled", "task_id": task_id}) diff --git a/src/main.py b/src/main.py index 73445ad9..874b76bf 100644 --- a/src/main.py +++ b/src/main.py @@ -101,7 +101,7 @@ async def wait_for_opensearch(): try: await clients.opensearch.info() logger.info("OpenSearch is ready") - await TelemetryClient.send_event(Category.OPENSEARCH_SETUP, MessageId.ORBTA0020I) + await TelemetryClient.send_event(Category.OPENSEARCH_SETUP, MessageId.ORB_OS_CONN_ESTABLISHED) return except Exception as e: logger.warning( @@ -113,7 +113,7 @@ async def wait_for_opensearch(): if attempt < max_retries - 1: await asyncio.sleep(retry_delay) else: - await TelemetryClient.send_event(Category.OPENSEARCH_SETUP, MessageId.ORBTA0023E) + await TelemetryClient.send_event(Category.OPENSEARCH_SETUP, MessageId.ORB_OS_TIMEOUT) raise Exception("OpenSearch failed to become ready") @@ -157,7 +157,7 @@ async def _ensure_opensearch_index(): "dimension" ], ) - await TelemetryClient.send_event(Category.OPENSEARCH_INDEX, MessageId.ORBTA0030I) + await TelemetryClient.send_event(Category.OPENSEARCH_INDEX, MessageId.ORB_OS_INDEX_CREATED) except Exception as e: logger.error( @@ -165,7 +165,7 @@ async def _ensure_opensearch_index(): error=str(e), index_name=INDEX_NAME, ) - await TelemetryClient.send_event(Category.OPENSEARCH_INDEX, MessageId.ORBTA0032E) + await TelemetryClient.send_event(Category.OPENSEARCH_INDEX, MessageId.ORB_OS_INDEX_CREATE_FAIL) # Don't raise the exception to avoid breaking the initialization # The service can still function, document operations might fail later @@ -198,14 +198,14 @@ async def init_index(): index_name=INDEX_NAME, embedding_model=embedding_model, ) - await TelemetryClient.send_event(Category.OPENSEARCH_INDEX, MessageId.ORBTA0030I) + await TelemetryClient.send_event(Category.OPENSEARCH_INDEX, MessageId.ORB_OS_INDEX_CREATED) else: logger.info( "Index already exists, skipping creation", index_name=INDEX_NAME, embedding_model=embedding_model, ) - await TelemetryClient.send_event(Category.OPENSEARCH_INDEX, MessageId.ORBTA0031I) + await TelemetryClient.send_event(Category.OPENSEARCH_INDEX, MessageId.ORB_OS_INDEX_EXISTS) # Create knowledge filters index knowledge_filter_index_name = "knowledge_filters" @@ -233,7 +233,7 @@ async def init_index(): logger.info( "Created knowledge filters index", index_name=knowledge_filter_index_name ) - await TelemetryClient.send_event(Category.OPENSEARCH_INDEX, MessageId.ORBTA0034I) + await TelemetryClient.send_event(Category.OPENSEARCH_INDEX, MessageId.ORB_OS_KF_INDEX_CREATED) else: logger.info( "Knowledge filters index already exists, skipping creation", @@ -287,7 +287,7 @@ def generate_jwt_keys(): logger.info("Generated RSA keys for JWT signing") except subprocess.CalledProcessError as e: logger.error("Failed to generate RSA keys", error=str(e)) - TelemetryClient.send_event_sync(Category.SERVICE_INITIALIZATION, MessageId.ORBTA0014E) + TelemetryClient.send_event_sync(Category.SERVICE_INITIALIZATION, MessageId.ORB_SVC_JWT_KEY_FAIL) raise else: # Ensure correct permissions on existing keys @@ -306,7 +306,7 @@ async def init_index_when_ready(): logger.info("OpenSearch index initialization completed successfully") except Exception as e: logger.error("OpenSearch index initialization failed", error=str(e)) - await TelemetryClient.send_event(Category.OPENSEARCH_INDEX, MessageId.ORBTA0033E) + await TelemetryClient.send_event(Category.OPENSEARCH_INDEX, MessageId.ORB_OS_INDEX_INIT_FAIL) logger.warning( "OIDC endpoints will still work, but document operations may fail until OpenSearch is ready" ) @@ -334,7 +334,7 @@ async def ingest_default_documents_when_ready(services): "Ingesting default documents when ready", disable_langflow_ingest=DISABLE_INGEST_WITH_LANGFLOW, ) - await TelemetryClient.send_event(Category.DOCUMENT_INGESTION, MessageId.ORBTA0043I) + await TelemetryClient.send_event(Category.DOCUMENT_INGESTION, MessageId.ORB_DOC_DEFAULT_START) base_dir = _get_documents_dir() if not os.path.isdir(base_dir): logger.info( @@ -362,11 +362,11 @@ async def ingest_default_documents_when_ready(services): else: await _ingest_default_documents_langflow(services, file_paths) - await TelemetryClient.send_event(Category.DOCUMENT_INGESTION, MessageId.ORBTA0044I) + await TelemetryClient.send_event(Category.DOCUMENT_INGESTION, MessageId.ORB_DOC_DEFAULT_COMPLETE) except Exception as e: logger.error("Default documents ingestion failed", error=str(e)) - await TelemetryClient.send_event(Category.DOCUMENT_INGESTION, MessageId.ORBTA0045E) + await TelemetryClient.send_event(Category.DOCUMENT_INGESTION, MessageId.ORB_DOC_DEFAULT_FAILED) async def _ingest_default_documents_langflow(services, file_paths): @@ -516,7 +516,7 @@ async def _update_mcp_servers_with_provider_credentials(services): async def startup_tasks(services): """Startup tasks""" logger.info("Starting startup tasks") - await TelemetryClient.send_event(Category.APPLICATION_STARTUP, MessageId.ORBTA0002I) + await TelemetryClient.send_event(Category.APPLICATION_STARTUP, MessageId.ORB_APP_START_INIT) # Only initialize basic OpenSearch connection, not the index # Index will be created after onboarding when we know the embedding model await wait_for_opensearch() @@ -542,24 +542,24 @@ async def startup_tasks(services): logger.info( f"Detected reset flows: {', '.join(reset_flows)}. Reapplying all settings." ) - await TelemetryClient.send_event(Category.FLOW_OPERATIONS, MessageId.ORBTA0082W) + await TelemetryClient.send_event(Category.FLOW_OPERATIONS, MessageId.ORB_FLOW_RESET_DETECTED) from api.settings import reapply_all_settings await reapply_all_settings(session_manager=services["session_manager"]) logger.info("Successfully reapplied settings after detecting flow resets") - await TelemetryClient.send_event(Category.FLOW_OPERATIONS, MessageId.ORBTA0084I) + await TelemetryClient.send_event(Category.FLOW_OPERATIONS, MessageId.ORB_FLOW_SETTINGS_REAPPLIED) else: logger.info("No flows detected as reset, skipping settings reapplication") else: logger.debug("Configuration not yet edited, skipping flow reset check") except Exception as e: logger.error(f"Failed to check flows reset or reapply settings: {str(e)}") - await TelemetryClient.send_event(Category.FLOW_OPERATIONS, MessageId.ORBTA0083E) + await TelemetryClient.send_event(Category.FLOW_OPERATIONS, MessageId.ORB_FLOW_RESET_CHECK_FAIL) # Don't fail startup if this check fails async def initialize_services(): """Initialize all services and their dependencies""" - await TelemetryClient.send_event(Category.SERVICE_INITIALIZATION, MessageId.ORBTA0011I) + await TelemetryClient.send_event(Category.SERVICE_INITIALIZATION, MessageId.ORB_SVC_INIT_START) # Generate JWT keys if they don't exist generate_jwt_keys() @@ -568,7 +568,7 @@ async def initialize_services(): await clients.initialize() except Exception as e: logger.error("Failed to initialize clients", error=str(e)) - await TelemetryClient.send_event(Category.SERVICE_INITIALIZATION, MessageId.ORBTA0013E) + await TelemetryClient.send_event(Category.SERVICE_INITIALIZATION, MessageId.ORB_SVC_OS_CLIENT_FAIL) raise # Initialize session manager @@ -632,11 +632,11 @@ async def initialize_services(): logger.warning( "Failed to load persisted connections on startup", error=str(e) ) - await TelemetryClient.send_event(Category.CONNECTOR_OPERATIONS, MessageId.ORBTA0077W) + await TelemetryClient.send_event(Category.CONNECTOR_OPERATIONS, MessageId.ORB_CONN_LOAD_FAILED) else: logger.info("[CONNECTORS] Skipping connection loading in no-auth mode") - await TelemetryClient.send_event(Category.SERVICE_INITIALIZATION, MessageId.ORBTA0010I) + await TelemetryClient.send_event(Category.SERVICE_INITIALIZATION, MessageId.ORB_SVC_INIT_SUCCESS) langflow_file_service = LangflowFileService() @@ -1250,7 +1250,7 @@ async def create_app(): # Add startup event handler @app.on_event("startup") async def startup_event(): - await TelemetryClient.send_event(Category.APPLICATION_STARTUP, MessageId.ORBTA0001I) + await TelemetryClient.send_event(Category.APPLICATION_STARTUP, MessageId.ORB_APP_STARTED) # Start index initialization in background to avoid blocking OIDC endpoints t1 = asyncio.create_task(startup_tasks(services)) app.state.background_tasks.add(t1) @@ -1298,7 +1298,7 @@ async def create_app(): # Add shutdown event handler @app.on_event("shutdown") async def shutdown_event(): - await TelemetryClient.send_event(Category.APPLICATION_SHUTDOWN, MessageId.ORBTA0003I) + await TelemetryClient.send_event(Category.APPLICATION_SHUTDOWN, MessageId.ORB_APP_SHUTDOWN) await cleanup_subscriptions_proper(services) # Cleanup async clients await clients.cleanup() diff --git a/src/services/document_service.py b/src/services/document_service.py index 544eb04e..de1b3cf6 100644 --- a/src/services/document_service.py +++ b/src/services/document_service.py @@ -99,7 +99,7 @@ class DocumentService: """Recreate the process pool if it's broken""" if self._process_pool_broken and self.process_pool: logger.warning("Attempting to recreate broken process pool") - TelemetryClient.send_event_sync(Category.DOCUMENT_PROCESSING, MessageId.ORBTA0053W) + TelemetryClient.send_event_sync(Category.DOCUMENT_PROCESSING, MessageId.ORB_DOC_POOL_RECREATE) try: # Shutdown the old pool self.process_pool.shutdown(wait=False) diff --git a/src/services/flows_service.py b/src/services/flows_service.py index b2816d5c..1a93489b 100644 --- a/src/services/flows_service.py +++ b/src/services/flows_service.py @@ -231,9 +231,9 @@ class FlowsService: # Send telemetry event if backup_results["failed"]: - await TelemetryClient.send_event(Category.FLOW_OPERATIONS, MessageId.ORBTA0081E) + await TelemetryClient.send_event(Category.FLOW_OPERATIONS, MessageId.ORB_FLOW_BACKUP_FAILED) else: - await TelemetryClient.send_event(Category.FLOW_OPERATIONS, MessageId.ORBTA0080I) + await TelemetryClient.send_event(Category.FLOW_OPERATIONS, MessageId.ORB_FLOW_BACKUP_COMPLETE) return backup_results diff --git a/src/services/task_service.py b/src/services/task_service.py index 5ab311e3..c86e96b1 100644 --- a/src/services/task_service.py +++ b/src/services/task_service.py @@ -136,7 +136,7 @@ class TaskService: asyncio.create_task( TelemetryClient.send_event( Category.TASK_OPERATIONS, - MessageId.ORBTA0090I, + MessageId.ORB_TASK_CREATED, metadata={ "total_files": len(items), "processor_type": processor.__class__.__name__, @@ -192,7 +192,7 @@ class TaskService: asyncio.create_task( TelemetryClient.send_event( Category.TASK_OPERATIONS, - MessageId.ORBTA0091I, + MessageId.ORB_TASK_COMPLETE, metadata={ "total_files": upload_task.total_files, "successful_files": upload_task.successful_files, @@ -217,7 +217,7 @@ class TaskService: asyncio.create_task( TelemetryClient.send_event( Category.TASK_OPERATIONS, - MessageId.ORBTA0092E, + MessageId.ORB_TASK_FAILED, metadata={ "total_files": failed_task.total_files, "processed_files": failed_task.processed_files, @@ -277,7 +277,7 @@ class TaskService: asyncio.create_task( TelemetryClient.send_event( Category.TASK_OPERATIONS, - MessageId.ORBTA0091I, + MessageId.ORB_TASK_COMPLETE, metadata={ "total_files": upload_task.total_files, "successful_files": upload_task.successful_files, @@ -308,7 +308,7 @@ class TaskService: asyncio.create_task( TelemetryClient.send_event( Category.TASK_OPERATIONS, - MessageId.ORBTA0092E, + MessageId.ORB_TASK_FAILED, metadata={ "total_files": failed_task.total_files, "processed_files": failed_task.processed_files, diff --git a/src/utils/telemetry/message_id.py b/src/utils/telemetry/message_id.py index 3600eb54..af242257 100644 --- a/src/utils/telemetry/message_id.py +++ b/src/utils/telemetry/message_id.py @@ -1,6 +1,7 @@ """Telemetry message IDs for OpenRAG backend. -All message IDs start with ORBTA (OpenRAG Backend Telemetry Analytics). +All message IDs start with ORB_ (OpenRAG Backend) followed by descriptive text. +Format: ORB__[_] """ @@ -10,192 +11,191 @@ class MessageId: # Category: APPLICATION_STARTUP -------------------------------------------> # Message: Application started successfully - ORBTA0001I = "ORBTA0001I" + ORB_APP_STARTED = "ORB_APP_STARTED" # Message: Application startup initiated - ORBTA0002I = "ORBTA0002I" + ORB_APP_START_INIT = "ORB_APP_START_INIT" # Message: Application shutdown initiated - ORBTA0003I = "ORBTA0003I" + ORB_APP_SHUTDOWN = "ORB_APP_SHUTDOWN" # Category: SERVICE_INITIALIZATION -----------------------------------------> # Message: Services initialized successfully - ORBTA0010I = "ORBTA0010I" + ORB_SVC_INIT_SUCCESS = "ORB_SVC_INIT_SUCCESS" # Message: Service initialization started - ORBTA0011I = "ORBTA0011I" + ORB_SVC_INIT_START = "ORB_SVC_INIT_START" # Message: Failed to initialize services - ORBTA0012E = "ORBTA0012E" + ORB_SVC_INIT_FAILED = "ORB_SVC_INIT_FAILED" # Message: Failed to initialize OpenSearch client - ORBTA0013E = "ORBTA0013E" + ORB_SVC_OS_CLIENT_FAIL = "ORB_SVC_OS_CLIENT_FAIL" # Message: Failed to generate JWT keys - ORBTA0014E = "ORBTA0014E" + ORB_SVC_JWT_KEY_FAIL = "ORB_SVC_JWT_KEY_FAIL" # Category: OPENSEARCH_SETUP ----------------------------------------------> # Message: OpenSearch connection established - ORBTA0020I = "ORBTA0020I" + ORB_OS_CONN_ESTABLISHED = "ORB_OS_CONN_ESTABLISHED" # Message: OpenSearch connection failed - ORBTA0021E = "ORBTA0021E" + ORB_OS_CONN_FAILED = "ORB_OS_CONN_FAILED" # Message: Waiting for OpenSearch to be ready - ORBTA0022W = "ORBTA0022W" + ORB_OS_WAITING = "ORB_OS_WAITING" # Message: OpenSearch ready check timeout - ORBTA0023E = "ORBTA0023E" + ORB_OS_TIMEOUT = "ORB_OS_TIMEOUT" # Category: OPENSEARCH_INDEX ----------------------------------------------> # Message: OpenSearch index created successfully - ORBTA0030I = "ORBTA0030I" + ORB_OS_INDEX_CREATED = "ORB_OS_INDEX_CREATED" # Message: OpenSearch index already exists - ORBTA0031I = "ORBTA0031I" + ORB_OS_INDEX_EXISTS = "ORB_OS_INDEX_EXISTS" # Message: Failed to create OpenSearch index - ORBTA0032E = "ORBTA0032E" + ORB_OS_INDEX_CREATE_FAIL = "ORB_OS_INDEX_CREATE_FAIL" # Message: Failed to initialize index - ORBTA0033E = "ORBTA0033E" + ORB_OS_INDEX_INIT_FAIL = "ORB_OS_INDEX_INIT_FAIL" # Message: Knowledge filters index created - ORBTA0034I = "ORBTA0034I" + ORB_OS_KF_INDEX_CREATED = "ORB_OS_KF_INDEX_CREATED" # Message: Failed to create knowledge filters index - ORBTA0035E = "ORBTA0035E" + ORB_OS_KF_INDEX_FAIL = "ORB_OS_KF_INDEX_FAIL" # Category: DOCUMENT_INGESTION --------------------------------------------> # Message: Document ingestion started - ORBTA0040I = "ORBTA0040I" + ORB_DOC_INGEST_START = "ORB_DOC_INGEST_START" # Message: Document ingestion completed successfully - ORBTA0041I = "ORBTA0041I" + ORB_DOC_INGEST_COMPLETE = "ORB_DOC_INGEST_COMPLETE" # Message: Document ingestion failed - ORBTA0042E = "ORBTA0042E" + ORB_DOC_INGEST_FAILED = "ORB_DOC_INGEST_FAILED" # Message: Default documents ingestion started - ORBTA0043I = "ORBTA0043I" + ORB_DOC_DEFAULT_START = "ORB_DOC_DEFAULT_START" # Message: Default documents ingestion completed - ORBTA0044I = "ORBTA0044I" + ORB_DOC_DEFAULT_COMPLETE = "ORB_DOC_DEFAULT_COMPLETE" # Message: Default documents ingestion failed - ORBTA0045E = "ORBTA0045E" + ORB_DOC_DEFAULT_FAILED = "ORB_DOC_DEFAULT_FAILED" # Category: DOCUMENT_PROCESSING --------------------------------------------> # Message: Document processing started - ORBTA0050I = "ORBTA0050I" + ORB_DOC_PROCESS_START = "ORB_DOC_PROCESS_START" # Message: Document processing completed - ORBTA0051I = "ORBTA0051I" + ORB_DOC_PROCESS_COMPLETE = "ORB_DOC_PROCESS_COMPLETE" # Message: Document processing failed - ORBTA0052E = "ORBTA0052E" + ORB_DOC_PROCESS_FAILED = "ORB_DOC_PROCESS_FAILED" # Message: Process pool recreation attempted - ORBTA0053W = "ORBTA0053W" + ORB_DOC_POOL_RECREATE = "ORB_DOC_POOL_RECREATE" # Category: AUTHENTICATION ------------------------------------------------> # Message: Authentication successful - ORBTA0060I = "ORBTA0060I" + ORB_AUTH_SUCCESS = "ORB_AUTH_SUCCESS" # Message: Authentication failed - ORBTA0061E = "ORBTA0061E" + ORB_AUTH_FAILED = "ORB_AUTH_FAILED" # Message: User logged out - ORBTA0062I = "ORBTA0062I" + ORB_AUTH_LOGOUT = "ORB_AUTH_LOGOUT" # Message: OAuth callback received - ORBTA0063I = "ORBTA0063I" + ORB_AUTH_OAUTH_CALLBACK = "ORB_AUTH_OAUTH_CALLBACK" # Message: OAuth callback failed - ORBTA0064E = "ORBTA0064E" + ORB_AUTH_OAUTH_FAILED = "ORB_AUTH_OAUTH_FAILED" # Category: CONNECTOR_OPERATIONS -------------------------------------------> # Message: Connector connection established - ORBTA0070I = "ORBTA0070I" + ORB_CONN_CONNECTED = "ORB_CONN_CONNECTED" # Message: Connector connection failed - ORBTA0071E = "ORBTA0071E" + ORB_CONN_CONNECT_FAILED = "ORB_CONN_CONNECT_FAILED" # Message: Connector sync started - ORBTA0072I = "ORBTA0072I" + ORB_CONN_SYNC_START = "ORB_CONN_SYNC_START" # Message: Connector sync completed - ORBTA0073I = "ORBTA0073I" + ORB_CONN_SYNC_COMPLETE = "ORB_CONN_SYNC_COMPLETE" # Message: Connector sync failed - ORBTA0074E = "ORBTA0074E" + ORB_CONN_SYNC_FAILED = "ORB_CONN_SYNC_FAILED" # Message: Connector webhook received - ORBTA0075I = "ORBTA0075I" + ORB_CONN_WEBHOOK_RECV = "ORB_CONN_WEBHOOK_RECV" # Message: Connector webhook failed - ORBTA0076E = "ORBTA0076E" + ORB_CONN_WEBHOOK_FAILED = "ORB_CONN_WEBHOOK_FAILED" # Message: Failed to load persisted connections - ORBTA0077W = "ORBTA0077W" + ORB_CONN_LOAD_FAILED = "ORB_CONN_LOAD_FAILED" # Category: FLOW_OPERATIONS ------------------------------------------------> # Message: Flow backup completed - ORBTA0080I = "ORBTA0080I" + ORB_FLOW_BACKUP_COMPLETE = "ORB_FLOW_BACKUP_COMPLETE" # Message: Flow backup failed - ORBTA0081E = "ORBTA0081E" + ORB_FLOW_BACKUP_FAILED = "ORB_FLOW_BACKUP_FAILED" # Message: Flow reset detected - ORBTA0082W = "ORBTA0082W" + ORB_FLOW_RESET_DETECTED = "ORB_FLOW_RESET_DETECTED" # Message: Flow reset check failed - ORBTA0083E = "ORBTA0083E" + ORB_FLOW_RESET_CHECK_FAIL = "ORB_FLOW_RESET_CHECK_FAIL" # Message: Settings reapplied after flow reset - ORBTA0084I = "ORBTA0084I" + ORB_FLOW_SETTINGS_REAPPLIED = "ORB_FLOW_SETTINGS_REAPPLIED" # Category: TASK_OPERATIONS ------------------------------------------------> # Message: Task created successfully - ORBTA0090I = "ORBTA0090I" + ORB_TASK_CREATED = "ORB_TASK_CREATED" # Message: Task completed successfully - ORBTA0091I = "ORBTA0091I" + ORB_TASK_COMPLETE = "ORB_TASK_COMPLETE" # Message: Task failed - ORBTA0092E = "ORBTA0092E" + ORB_TASK_FAILED = "ORB_TASK_FAILED" # Message: Task cancelled - ORBTA0093I = "ORBTA0093I" + ORB_TASK_CANCELLED = "ORB_TASK_CANCELLED" # Message: Task cancellation failed - ORBTA0094E = "ORBTA0094E" + ORB_TASK_CANCEL_FAILED = "ORB_TASK_CANCEL_FAILED" # Category: CHAT_OPERATIONS ------------------------------------------------> # Message: Chat request received - ORBTA0100I = "ORBTA0100I" + ORB_CHAT_REQUEST_RECV = "ORB_CHAT_REQUEST_RECV" # Message: Chat request completed - ORBTA0101I = "ORBTA0101I" + ORB_CHAT_REQUEST_COMPLETE = "ORB_CHAT_REQUEST_COMPLETE" # Message: Chat request failed - ORBTA0102E = "ORBTA0102E" + ORB_CHAT_REQUEST_FAILED = "ORB_CHAT_REQUEST_FAILED" # Category: ERROR_CONDITIONS -----------------------------------------------> # Message: Critical error occurred - ORBTA0110E = "ORBTA0110E" + ORB_ERROR_CRITICAL = "ORB_ERROR_CRITICAL" # Message: Warning condition - ORBTA0111W = "ORBTA0111W" + ORB_ERROR_WARNING = "ORB_ERROR_WARNING" # Category: SETTINGS_OPERATIONS --------------------------------------------> # Message: Settings updated successfully - ORBTA0120I = "ORBTA0120I" + ORB_SETTINGS_UPDATED = "ORB_SETTINGS_UPDATED" # Message: Settings update failed - ORBTA0121E = "ORBTA0121E" + ORB_SETTINGS_UPDATE_FAILED = "ORB_SETTINGS_UPDATE_FAILED" # Message: LLM provider changed - ORBTA0122I = "ORBTA0122I" + ORB_SETTINGS_LLM_PROVIDER = "ORB_SETTINGS_LLM_PROVIDER" # Message: LLM model changed - ORBTA0123I = "ORBTA0123I" + ORB_SETTINGS_LLM_MODEL = "ORB_SETTINGS_LLM_MODEL" # Message: Embedding provider changed - ORBTA0124I = "ORBTA0124I" + ORB_SETTINGS_EMBED_PROVIDER = "ORB_SETTINGS_EMBED_PROVIDER" # Message: Embedding model changed - ORBTA0125I = "ORBTA0125I" + ORB_SETTINGS_EMBED_MODEL = "ORB_SETTINGS_EMBED_MODEL" # Message: System prompt updated - ORBTA0126I = "ORBTA0126I" + ORB_SETTINGS_SYSTEM_PROMPT = "ORB_SETTINGS_SYSTEM_PROMPT" # Message: Chunk settings updated - ORBTA0127I = "ORBTA0127I" + ORB_SETTINGS_CHUNK_UPDATED = "ORB_SETTINGS_CHUNK_UPDATED" # Message: Docling settings updated - ORBTA0128I = "ORBTA0128I" + ORB_SETTINGS_DOCLING_UPDATED = "ORB_SETTINGS_DOCLING_UPDATED" # Message: Provider credentials updated - ORBTA0129I = "ORBTA0129I" + ORB_SETTINGS_PROVIDER_CREDS = "ORB_SETTINGS_PROVIDER_CREDS" # Category: ONBOARDING -----------------------------------------------------> # Message: Onboarding started - ORBTA0130I = "ORBTA0130I" + ORB_ONBOARD_START = "ORB_ONBOARD_START" # Message: Onboarding completed successfully - ORBTA0131I = "ORBTA0131I" + ORB_ONBOARD_COMPLETE = "ORB_ONBOARD_COMPLETE" # Message: Onboarding failed - ORBTA0132E = "ORBTA0132E" + ORB_ONBOARD_FAILED = "ORB_ONBOARD_FAILED" # Message: LLM provider selected during onboarding - ORBTA0133I = "ORBTA0133I" + ORB_ONBOARD_LLM_PROVIDER = "ORB_ONBOARD_LLM_PROVIDER" # Message: LLM model selected during onboarding - ORBTA0134I = "ORBTA0134I" + ORB_ONBOARD_LLM_MODEL = "ORB_ONBOARD_LLM_MODEL" # Message: Embedding provider selected during onboarding - ORBTA0135I = "ORBTA0135I" + ORB_ONBOARD_EMBED_PROVIDER = "ORB_ONBOARD_EMBED_PROVIDER" # Message: Embedding model selected during onboarding - ORBTA0136I = "ORBTA0136I" + ORB_ONBOARD_EMBED_MODEL = "ORB_ONBOARD_EMBED_MODEL" # Message: Sample data ingestion requested - ORBTA0137I = "ORBTA0137I" + ORB_ONBOARD_SAMPLE_DATA = "ORB_ONBOARD_SAMPLE_DATA" # Message: Configuration marked as edited - ORBTA0138I = "ORBTA0138I" - + ORB_ONBOARD_CONFIG_EDITED = "ORB_ONBOARD_CONFIG_EDITED"