diff --git a/celery_app/server.py b/celery_app/server.py index 46be7e5..499aff0 100644 --- a/celery_app/server.py +++ b/celery_app/server.py @@ -1,8 +1,4 @@ -import os - from celery import Celery -from dotenv import load_dotenv -from traceloop.sdk import Traceloop from utils.credentials import load_rabbitmq_credentials rabbit_creds = load_rabbitmq_credentials() @@ -11,9 +7,5 @@ host = rabbit_creds["host"] port = rabbit_creds["port"] -load_dotenv() -otel_endpoint = os.getenv("TRACELOOP_BASE_URL") -Traceloop.init(api_endpoint=otel_endpoint, app_name="hivemind-server") - app = Celery("celery_app/tasks", broker=f"pyamqp://{user}:{password}@{host}:{port}//") app.autodiscover_tasks(["celery_app"]) diff --git a/celery_app/tasks.py b/celery_app/tasks.py index 991a8f9..9fc28a9 100644 --- a/celery_app/tasks.py +++ b/celery_app/tasks.py @@ -14,6 +14,7 @@ ) from tc_messageBroker.rabbit_mq.payload.payload import Payload from tc_messageBroker.rabbit_mq.queue import Queue +from traceloop.sdk import Traceloop @app.task @@ -40,6 +41,8 @@ def ask_question_auto_search( - `date` - `content`: which is the `ChatInputCommandInteraction` as a dictionary """ + Traceloop.init(app_name="hivemind-server") + prefix = f"COMMUNITY_ID: {community_id} | " logging.info(f"{prefix}Processing question!")